protected final String createJpqlStreamSelect(final StreamId streamId) {

        if (streamId.isProjection()) {
            throw new IllegalArgumentException("Projections do not have a stream table : " + streamId);
        }

        final List<KeyValue> params = new ArrayList<>(streamId.getParameters());
        if (params.size() == 0) {
            // NoParamsStream
            params.add(new KeyValue("streamName", streamId.getName()));
        }
        final StringBuilder sb = new StringBuilder("SELECT t FROM " + streamEntityName(streamId) + " t");
        sb.append(" WHERE ");
        for (int i = 0; i < params.size(); i++) {
            final KeyValue param = params.get(i);
            if (i > 0) {
                sb.append(" AND ");
            }
            sb.append("t." + param.getKey() + "=:" + param.getKey());
        }
        return sb.toString();
    }
protected final String createJpqlStreamSelect ( final StreamId streamId ) { if ( streamId . isProjection ( ) ) { throw new IllegalArgumentException ( "Projections do not have a stream table : " + streamId ) ; } final List < KeyValue > params = new ArrayList < > ( streamId . getParameters ( ) ) ; if ( params . size ( ) == 0 ) { params . add ( new KeyValue ( "streamName" , streamId . getName ( ) ) ) ; } final StringBuilder sb = new StringBuilder ( "SELECT t FROM " + streamEntityName ( streamId ) + " t" ) ; sb . append ( " WHERE " ) ; for ( int i = 0 ; i < params . size ( ) ; i ++ ) { final KeyValue param = params . get ( i ) ; if ( i > 0 ) { sb . append ( " AND " ) ; } sb . append ( "t." + param . getKey ( ) + "=:" + param . getKey ( ) ) ; } return sb . toString ( ) ; }
Creates the JPQL to select the stream itself.

@param streamId
Unique stream identifier.

@return JPQL that selects the stream with the given identifier.