Source:
<code>public ClosableIterator<Tuple> executeBackendQuery(BackendQuery<IgniteQueryDescriptor> backendQuery, QueryParameters queryParameters, TupleContext tupleContext) { IgniteCache<Object, BinaryObject> cache; if ( backendQuery.getSingleEntityMetadataInformationOrNull() != null ) { cache = provider.getEntityCache( backendQuery.getSingleEntityMetadataInformationOrNull().getEntityKeyMetadata() ); } else if ( backendQuery.getQuery().getQuerySpaces().size() > 0 ) { cache = provider.getEntityCache( backendQuery.getQuery().getQuerySpaces().iterator().next() ); } else { throw new IgniteHibernateException( "Can't find cache name" ); } QueryHints hints = ( new QueryHints.Builder( queryParameters.getQueryHints() ) ).build(); SqlFieldsQuery sqlQuery = provider.createSqlFieldsQueryWithLog( backendQuery.getQuery().getSql(), hints, IgniteHqlQueryParser.createParameterList( backendQuery.getQuery().getOriginalSql(), queryParameters.getNamedParameters() ).toArray() ); Iterable<List<?>> result = executeWithHints( cache, sqlQuery, hints ); if ( backendQuery.getQuery().isHasScalar() ) { return new IgniteProjectionResultCursor( result, backendQuery.getQuery().getCustomQueryReturns(), queryParameters.getRowSelection() ); } else { if ( backendQuery.getSingleEntityMetadataInformationOrNull() != null ) { return new IgnitePortableFromProjectionResultCursor( result, queryParameters.getRowSelection(), backendQuery.getSingleEntityMetadataInformationOrNull().getEntityKeyMetadata() ); } else { <START> throw new UnsupportedOperationException( "Not implemented yet" ); <END> } } }</code><technical_language>expect this method do compare approach. HQL query convert SQL this method received SQL query. This method is in situations: 1. user wants execute native queries: session.createNativeQuery( "select * Poem p name = 'Oscar Wilde'" ) ... ; 2. user wants execute HQL queries: in this case Hibernate OGM convert query a native backend query (SQL in this case I suspect) call executeBackendQuery(...) SQL query obtained. this need create a class extends SingleEntityQueryRendererDelegate, some example in Neo4j dialect ot MongoDB dialect</technical_language>

Target:
public ClosableIterator<Tuple> executeBackendQuery(BackendQuery<IgniteQueryDescriptor> backendQuery, QueryParameters queryParameters, TupleContext tupleContext) { IgniteCache<Object, BinaryObject> cache; if ( backendQuery.getSingleEntityMetadataInformationOrNull() != null ) { cache = provider.getEntityCache( backendQuery.getSingleEntityMetadataInformationOrNull().getEntityKeyMetadata() ); } else { throw new UnsupportedOperationException( "Not implemented. Can't find cache name" ); } QueryHints hints = ( new QueryHints.Builder( queryParameters.getQueryHints() ) ).build(); SqlFieldsQuery sqlQuery = provider.createSqlFieldsQueryWithLog( backendQuery.getQuery().getSql(), hints, backendQuery.getQuery().getIndexedParameters() != null ? backendQuery.getQuery().getIndexedParameters().toArray() : null ); Iterable<List<?>> result = executeWithHints( cache, sqlQuery, hints ); if ( backendQuery.getSingleEntityMetadataInformationOrNull() != null ) { return new IgnitePortableFromProjectionResultCursor( result, queryParameters.getRowSelection(), backendQuery.getSingleEntityMetadataInformationOrNull().getEntityKeyMetadata() ); } else if ( backendQuery.getQuery().isHasScalar() ) { throw new NotYetImplementedException(); } else { throw new UnsupportedOperationException( "Not implemented yet" ); } }