code: protected final void setJpqlParameters(final Query query, final StreamId streamId) {
          final List<KeyValue> params = new ArrayList<>(streamId.getParameters());
          if (params.size() == 0) {
              params.add(new KeyValue("streamName", streamId.getName()));
          }
          for (int i = 0; i < params.size(); i++) {
              final KeyValue param = params.get(i);
              query.setParameter(param.getKey(), param.getValue());
          }
      }
docs: Sets parameters in a query.
  
  @param query
  Query to set parameters for.
  @param streamId
  Unique stream identifier that has the parameter values.