Package org.hibernate.query.sqm.internal
Class ConcreteSqmSelectQueryPlan<R>
java.lang.Object
org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan<R>
- All Implemented Interfaces:
QueryPlan,SelectQueryPlan<R>
Standard implementation of
SelectQueryPlan for SQM-backed
implementations of Query, that is, for
HQL/JPQL or for CriteriaQuery.-
Constructor Summary
ConstructorsConstructorDescriptionConcreteSqmSelectQueryPlan(SqmSelectStatement<?> sqm, String hql, DomainParameterXref domainParameterXref, Class<R> resultType, TupleMetadata tupleMetadata, QueryOptions queryOptions) -
Method Summary
Modifier and TypeMethodDescriptionprotected static CacheableSqmInterpretation<SelectStatement, JdbcOperationQuerySelect> buildInterpretation(SqmSelectStatement<?> sqm, DomainParameterXref domainParameterXref, DomainQueryExecutionContext executionContext, MutableObject<JdbcParameterBindings> firstJdbcParameterBindingsConsumer) protected JdbcParameterBindingscreateJdbcParameterBindings(CacheableSqmInterpretation<SelectStatement, JdbcOperationQuerySelect> sqmInterpretation, DomainQueryExecutionContext executionContext) protected static <T> RowTransformer<T> determineRowTransformer(SqmSelectStatement<?> sqm, Class<T> resultClass, TupleMetadata tupleMetadata, QueryOptions queryOptions) If the result type of the query isTuple,Map,List, or any record or class type with an appropriate constructor, then we attempt to repackage the result tuple as an instance of the result type using an appropriateRowTransformer.<T> TexecuteQuery(DomainQueryExecutionContext executionContext, ResultsConsumer<T, R> resultsConsumer) Execute the queryprotected static intinterpretIntExpression(Expression expression, JdbcParameterBindings jdbcParameterBindings) protected static SqmJdbcExecutionContextAdapterlistInterpreterExecutionContext(String hql, DomainQueryExecutionContext executionContext, JdbcOperationQuerySelect jdbcSelect, SubselectFetch.RegistrationHandler subSelectFetchKeyHandler) performList(DomainQueryExecutionContext executionContext) Perform (execute) the query returning a ListperformScroll(ScrollMode scrollMode, DomainQueryExecutionContext executionContext) Perform (execute) the query returning a ScrollableResults
-
Constructor Details
-
ConcreteSqmSelectQueryPlan
public ConcreteSqmSelectQueryPlan(SqmSelectStatement<?> sqm, String hql, DomainParameterXref domainParameterXref, Class<R> resultType, TupleMetadata tupleMetadata, QueryOptions queryOptions)
-
-
Method Details
-
listInterpreterExecutionContext
protected static SqmJdbcExecutionContextAdapter listInterpreterExecutionContext(String hql, DomainQueryExecutionContext executionContext, JdbcOperationQuerySelect jdbcSelect, SubselectFetch.RegistrationHandler subSelectFetchKeyHandler) -
interpretIntExpression
protected static int interpretIntExpression(Expression expression, JdbcParameterBindings jdbcParameterBindings) -
determineRowTransformer
protected static <T> RowTransformer<T> determineRowTransformer(SqmSelectStatement<?> sqm, Class<T> resultClass, TupleMetadata tupleMetadata, QueryOptions queryOptions) If the result type of the query isTuple,Map,List, or any record or class type with an appropriate constructor, then we attempt to repackage the result tuple as an instance of the result type using an appropriateRowTransformer.- Parameters:
resultClass- The requested result type of the query- Returns:
- A
RowTransformerresponsible for repackaging the result type
-
executeQuery
public <T> T executeQuery(DomainQueryExecutionContext executionContext, ResultsConsumer<T, R> resultsConsumer) Description copied from interface:SelectQueryPlanExecute the query- Specified by:
executeQueryin interfaceSelectQueryPlan<R>
-
performList
Description copied from interface:SelectQueryPlanPerform (execute) the query returning a List- Specified by:
performListin interfaceSelectQueryPlan<R>
-
performScroll
public ScrollableResultsImplementor<R> performScroll(ScrollMode scrollMode, DomainQueryExecutionContext executionContext) Description copied from interface:SelectQueryPlanPerform (execute) the query returning a ScrollableResults- Specified by:
performScrollin interfaceSelectQueryPlan<R>
-
createJdbcParameterBindings
protected JdbcParameterBindings createJdbcParameterBindings(CacheableSqmInterpretation<SelectStatement, JdbcOperationQuerySelect> sqmInterpretation, DomainQueryExecutionContext executionContext) -
buildInterpretation
protected static CacheableSqmInterpretation<SelectStatement,JdbcOperationQuerySelect> buildInterpretation(SqmSelectStatement<?> sqm, DomainParameterXref domainParameterXref, DomainQueryExecutionContext executionContext, MutableObject<JdbcParameterBindings> firstJdbcParameterBindingsConsumer)
-