NoSQLQuery query = new NoSQLQueryImpl( result.getQuery(), (SessionImplementor) session, new ParameterMetadata( null, null ) );
// Register the result types of the query; Currently either a number of scalar values or an entity return
// are supported only; JP-QL would actually a combination of both, though (see OGM-514)
if ( hasProjections( result ) ) {
for ( String field : result.getProjections() ) {
query.addScalar( field );
}
}
else {
query.addEntity( result.getEntityType() );
}