Top Description Inners Fields Constructors Methods
org.hibernate.query.sqm.internal

public Class ConcreteSqmSelectQueryPlan<R>

extends Object
implements SelectQueryPlan<R>
Class Inheritance
All Implemented Interfaces
org.hibernate.query.spi.SelectQueryPlan, org.hibernate.query.spi.QueryPlan
Imports
java.util.ArrayList, .Collections, .List, .Map, jakarta.persistence.Tuple, org.hibernate.AssertionFailure, .InstantiationException, .ScrollMode, org.hibernate.engine.spi.EntityHolder, .SessionFactoryImplementor, .SharedSessionContractImplementor, .SubselectFetch, org.hibernate.internal.EmptyScrollableResults, org.hibernate.internal.util.collections.ArrayHelper, org.hibernate.metamodel.mapping.MappingModelExpressible, org.hibernate.query.Query, .TupleTransformer, org.hibernate.query.spi.DomainQueryExecutionContext, .QueryOptions, .QueryParameterImplementor, .ScrollableResultsImplementor, .SelectQueryPlan, org.hibernate.query.sqm.spi.SqmParameterMappingModelResolutionAccess, org.hibernate.query.sqm.sql.SqmTranslation, org.hibernate.query.sqm.tree.expression.SqmParameter, org.hibernate.query.sqm.tree.select.SqmDynamicInstantiation, .SqmSelectStatement, .SqmSelection, org.hibernate.sql.ast.SqlAstTranslator, org.hibernate.sql.ast.spi.FromClauseAccess, org.hibernate.sql.ast.tree.select.SelectStatement, org.hibernate.sql.exec.spi.JdbcOperationQuerySelect, .JdbcParameterBindings, .JdbcParametersList, .JdbcSelectExecutor, org.hibernate.sql.results.internal.RowTransformerArrayImpl, .RowTransformerConstructorImpl, .RowTransformerJpaTupleImpl, .RowTransformerListImpl, .RowTransformerMapImpl, .RowTransformerSingularReturnImpl, .RowTransformerStandardImpl, .RowTransformerTupleTransformerAdapter, .TupleMetadata, org.hibernate.sql.results.spi.ListResultsConsumer, .ResultsConsumer, .RowTransformer

Standard Hibernate implementation of SelectQueryPlan for SQM-backed Query implementations, which means HQL/JPQL or jakarta.persistence.criteria.CriteriaQuery
Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static interface

Field Summary

Modifier and TypeField and Description
private volatile ConcreteSqmSelectQueryPlan.CacheableSqmInterpretation
private final DomainParameterXref
private final ConcreteSqmSelectQueryPlan.SqmInterpreter<Object, ResultsConsumer<?, R>>
private final ConcreteSqmSelectQueryPlan.SqmInterpreter<List<R>, Void>
private final RowTransformer<R>
private final ConcreteSqmSelectQueryPlan.SqmInterpreter<ScrollableResultsImplementor<R>, ScrollMode>
private final SqmSelectStatement<?>

Constructor Summary

AccessConstructor and Description
public
ConcreteSqmSelectQueryPlan(SqmSelectStatement<?> sqm, String hql, DomainParameterXref domainParameterXref, Class<R> resultType, TupleMetadata tupleMetadata, QueryOptions queryOptions)

Method Summary

Modifier and TypeMethod and Description
private static ConcreteSqmSelectQueryPlan.CacheableSqmInterpretation
private JdbcParameterBindings
protected static <T> RowTransformer<T>
determineRowTransformer(SqmSelectStatement<?> sqm, Class<T> resultType, TupleMetadata tupleMetadata, QueryOptions queryOptions)

public <T> T
executeQuery(DomainQueryExecutionContext executionContext, ResultsConsumer<T, R> resultsConsumer)

Implements org.hibernate.query.spi.SelectQueryPlan.executeQuery.

Execute the query
protected static SqmJdbcExecutionContextAdapter
private static <T> RowTransformer<T>
public List<R>
performList(DomainQueryExecutionContext executionContext)

Implements org.hibernate.query.spi.SelectQueryPlan.performList.

Perform (execute) the query returning a List
public ScrollableResultsImplementor<R>
performScroll(ScrollMode scrollMode, DomainQueryExecutionContext executionContext)

Implements org.hibernate.query.spi.SelectQueryPlan.performScroll.

Perform (execute) the query returning a ScrollableResults
private static Class<?>
private static SqmSelection<?>
private <T, X> T
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheableSqmInterpretationback to summary
private volatile ConcreteSqmSelectQueryPlan.CacheableSqmInterpretation cacheableSqmInterpretation
domainParameterXrefback to summary
private final DomainParameterXref domainParameterXref
executeQueryInterpreterback to summary
private final ConcreteSqmSelectQueryPlan.SqmInterpreter<Object, ResultsConsumer<?, R>> executeQueryInterpreter
listInterpreterback to summary
private final ConcreteSqmSelectQueryPlan.SqmInterpreter<List<R>, Void> listInterpreter
rowTransformerback to summary
private final RowTransformer<R> rowTransformer
scrollInterpreterback to summary
private final ConcreteSqmSelectQueryPlan.SqmInterpreter<ScrollableResultsImplementor<R>, ScrollMode> scrollInterpreter
sqmback to summary
private final SqmSelectStatement<?> sqm

Constructor Detail

ConcreteSqmSelectQueryPlanback to summary
public ConcreteSqmSelectQueryPlan(SqmSelectStatement<?> sqm, String hql, DomainParameterXref domainParameterXref, Class<R> resultType, TupleMetadata tupleMetadata, QueryOptions queryOptions)

Method Detail

buildCacheableSqmInterpretationback to summary
private static ConcreteSqmSelectQueryPlan.CacheableSqmInterpretation buildCacheableSqmInterpretation(SqmSelectStatement<?> sqm, DomainParameterXref domainParameterXref, DomainQueryExecutionContext executionContext)
createJdbcParameterBindingsback to summary
private JdbcParameterBindings createJdbcParameterBindings(ConcreteSqmSelectQueryPlan.CacheableSqmInterpretation sqmInterpretation, DomainQueryExecutionContext executionContext)
determineRowTransformerback to summary
protected static <T> RowTransformer<T> determineRowTransformer(SqmSelectStatement<?> sqm, Class<T> resultType, TupleMetadata tupleMetadata, QueryOptions queryOptions)
Annotations
@SuppressWarnings:unchecked
executeQueryback to summary
public <T> T executeQuery(DomainQueryExecutionContext executionContext, ResultsConsumer<T, R> resultsConsumer)

Implements org.hibernate.query.spi.SelectQueryPlan.executeQuery.

Doc from org.hibernate.query.spi.SelectQueryPlan.executeQuery.

Execute the query

Annotations
@Override
listInterpreterExecutionContextback to summary
protected static SqmJdbcExecutionContextAdapter listInterpreterExecutionContext(String hql, DomainQueryExecutionContext executionContext, JdbcOperationQuerySelect jdbcSelect, SubselectFetch.RegistrationHandler subSelectFetchKeyHandler)
makeRowTransformerTupleTransformerAdapterback to summary
private static <T> RowTransformer<T> makeRowTransformerTupleTransformerAdapter(SqmSelectStatement<?> sqm, QueryOptions queryOptions)
performListback to summary
public List<R> performList(DomainQueryExecutionContext executionContext)

Implements org.hibernate.query.spi.SelectQueryPlan.performList.

Doc from org.hibernate.query.spi.SelectQueryPlan.performList.

Perform (execute) the query returning a List

Annotations
@Override
performScrollback to summary
public ScrollableResultsImplementor<R> performScroll(ScrollMode scrollMode, DomainQueryExecutionContext executionContext)

Implements org.hibernate.query.spi.SelectQueryPlan.performScroll.

Doc from org.hibernate.query.spi.SelectQueryPlan.performScroll.

Perform (execute) the query returning a ScrollableResults

Annotations
@Override
selectionTypeback to summary
private static Class<?> selectionType(SqmSelection<?> selection)
singleSelectionback to summary
private static SqmSelection<?> singleSelection(SqmSelectStatement<?> sqm)
withCacheableSqmInterpretationback to summary
private <T, X> T withCacheableSqmInterpretation(DomainQueryExecutionContext executionContext, X context, ConcreteSqmSelectQueryPlan.SqmInterpreter<T, X> interpreter)
org.hibernate.query.sqm.internal back to summary

private Class ConcreteSqmSelectQueryPlan.CacheableSqmInterpretation

extends Object
Class Inheritance
  • java.lang.Object
  • org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.CacheableSqmInterpretation

Field Summary

Modifier and TypeField and Description
private transient JdbcParameterBindings
private final Map<QueryParameterImplementor<?>, Map<SqmParameter<?>, List<JdbcParametersList>>>
private final JdbcOperationQuerySelect
private final SelectStatement
private final Map<SqmParameter<?>, MappingModelExpressible<?>>
private final FromClauseAccess

Constructor Summary

AccessConstructor and Description
pack-priv
CacheableSqmInterpretation(SelectStatement selectStatement, JdbcOperationQuerySelect jdbcSelect, FromClauseAccess tableGroupAccess, Map<QueryParameterImplementor<?>, Map<SqmParameter<?>, List<JdbcParametersList>>> jdbcParamsXref, Map<SqmParameter<?>, MappingModelExpressible<?>> sqmParameterMappingModelTypes, JdbcParameterBindings firstParameterBindings)

Method Summary

Modifier and TypeMethod and Description
pack-priv JdbcParameterBindings
pack-priv Map<QueryParameterImplementor<?>, Map<SqmParameter<?>, List<JdbcParametersList>>>
pack-priv JdbcOperationQuerySelect
pack-priv SelectStatement
public Map<SqmParameter<?>, MappingModelExpressible<?>>
pack-priv FromClauseAccess
pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

firstParameterBindingsback to summary
private transient JdbcParameterBindings firstParameterBindings
jdbcParamsXrefback to summary
private final Map<QueryParameterImplementor<?>, Map<SqmParameter<?>, List<JdbcParametersList>>> jdbcParamsXref
jdbcSelectback to summary
private final JdbcOperationQuerySelect jdbcSelect
selectStatementback to summary
private final SelectStatement selectStatement
sqmParameterMappingModelTypesback to summary
private final Map<SqmParameter<?>, MappingModelExpressible<?>> sqmParameterMappingModelTypes
tableGroupAccessback to summary
private final FromClauseAccess tableGroupAccess

Constructor Detail

CacheableSqmInterpretationback to summary
pack-priv CacheableSqmInterpretation(SelectStatement selectStatement, JdbcOperationQuerySelect jdbcSelect, FromClauseAccess tableGroupAccess, Map<QueryParameterImplementor<?>, Map<SqmParameter<?>, List<JdbcParametersList>>> jdbcParamsXref, Map<SqmParameter<?>, MappingModelExpressible<?>> sqmParameterMappingModelTypes, JdbcParameterBindings firstParameterBindings)

Method Detail

getFirstParameterBindingsback to summary
pack-priv JdbcParameterBindings getFirstParameterBindings()
getJdbcParamsXrefback to summary
pack-priv Map<QueryParameterImplementor<?>, Map<SqmParameter<?>, List<JdbcParametersList>>> getJdbcParamsXref()
getJdbcSelectback to summary
pack-priv JdbcOperationQuerySelect getJdbcSelect()
getSelectStatementback to summary
pack-priv SelectStatement getSelectStatement()
getSqmParameterMappingModelTypesback to summary
public Map<SqmParameter<?>, MappingModelExpressible<?>> getSqmParameterMappingModelTypes()
getTableGroupAccessback to summary
pack-priv FromClauseAccess getTableGroupAccess()
setFirstParameterBindingsback to summary
pack-priv void setFirstParameterBindings(JdbcParameterBindings firstParameterBindings)
org.hibernate.query.sqm.internal back to summary

private Class ConcreteSqmSelectQueryPlan.MySqmJdbcExecutionContextAdapter

extends SqmJdbcExecutionContextAdapter
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final String
private final SubselectFetch.RegistrationHandler

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
public void
Inherited from org.hibernate.query.sqm.internal.SqmJdbcExecutionContextAdapter:
getCallbackgetQueryOptionsgetQueryParameterBindingshasCallbackActionshasQueryExecutionToBeAddedToStatisticsomittingLockingAndPagingupgradeLocksusingLockingAndPaging

Field Detail

hqlback to summary
private final String hql
subSelectFetchKeyHandlerback to summary
private final SubselectFetch.RegistrationHandler subSelectFetchKeyHandler

Constructor Detail

MySqmJdbcExecutionContextAdapterback to summary
public MySqmJdbcExecutionContextAdapter(DomainQueryExecutionContext executionContext, JdbcOperationQuerySelect jdbcSelect, SubselectFetch.RegistrationHandler subSelectFetchKeyHandler, String hql)

Method Detail

getQueryIdentifierback to summary
public String getQueryIdentifier(String sql)

Overrides org.hibernate.sql.exec.internal.BaseExecutionContext.getQueryIdentifier.

Implements org.hibernate.sql.exec.spi.ExecutionContext.getQueryIdentifier.

Annotations
@Override
registerLoadingEntityHolderback to summary
public void registerLoadingEntityHolder(EntityHolder holder)

Overrides default org.hibernate.sql.exec.spi.ExecutionContext.registerLoadingEntityHolder.

Annotations
@Override
org.hibernate.query.sqm.internal back to summary

private Interface ConcreteSqmSelectQueryPlan.SqmInterpreter<T, X>


Method Summary

Modifier and TypeMethod and Description
public T
interpret(X context, DomainQueryExecutionContext executionContext, ConcreteSqmSelectQueryPlan.CacheableSqmInterpretation sqmInterpretation, JdbcParameterBindings jdbcParameterBindings)

Method Detail

interpretback to summary
public T interpret(X context, DomainQueryExecutionContext executionContext, ConcreteSqmSelectQueryPlan.CacheableSqmInterpretation sqmInterpretation, JdbcParameterBindings jdbcParameterBindings)