Class LoaderSqlAstCreationState
java.lang.Object
org.hibernate.loader.ast.internal.LoaderSqlAstCreationState
- All Implemented Interfaces:
QueryOptions
,SqlAstCreationState
,SqlAstProcessingState
,SqlAstQueryNodeProcessingState
,SqlAstQueryPartProcessingState
,DomainResultCreationState
public class LoaderSqlAstCreationState
extends Object
implements SqlAstQueryPartProcessingState, SqlAstCreationState, DomainResultCreationState, QueryOptions
Helper used when generating the database-snapshot select query
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.hibernate.query.spi.QueryOptions
NONE, READ_ONLY, READ_WRITE
-
Constructor Summary
ConstructorsConstructorDescriptionLoaderSqlAstCreationState
(QueryPart queryPart, SqlAliasBaseManager sqlAliasBaseManager, FromClauseAccess fromClauseAccess, LockOptions lockOptions, LoaderSqlAstCreationState.FetchProcessor fetchProcessor, boolean forceIdentifierSelection, LoadQueryInfluencers loadQueryInfluencers, SqlAstCreationContext sf) -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
applyOrdering
(TableGroup tableGroup, OrderByFragment orderByFragment) void
applyPredicate
(Predicate predicate) Apply the predicate to be used for the final statement.boolean
Whether forcing the selection of the identifier is in effect for this creationJPAEntityGraph
explicitly applied to the query.Controls whether query results are read from the cache.Controls whether query results are put into the cache.The SQL comment to apply to the interpreted SQL query, for dialects which support SQL commentsReturns the part of the foreign key that is currently being resolved, ornull
if no foreign key is currently being resolved.Hints to apply to the interpreted SQL queryThe explicitly disabled profiles for this queryThe explicitly enabled profiles for this queryThe fetch size to be applied to the JDBC query.The flush mode to use for the query executionReturns the in-flight from clause for the query node.Returns the treated SqmFroms and whether theirEntityNameUse.TREAT
should be downgraded toEntityNameUse.EXPRESSION
.Get the QueryPart being processed as part of this state.getLimit()
The limit to the query results.Describes the locking to apply to the query resultsShould the query plan of the query be cached?The query cache region in which the results should be cached.Transformer applied to the query to transform the structure of the overall resultsThe underlying state for SQL AST creationThe timeout to apply to the query.Transformer applied to the query to transform the structure of each "row" in the resultsboolean
isAssociationKeyVisited
(AssociationKey associationKey) Checks whether the given circularityKey is registeredShould entities returned from the query be marked read-only.boolean
Is this state accepting circularity detection keys?boolean
Should results from the query be cached?void
registerFromUsage
(SqmFrom<?, ?> sqmFrom, boolean downgradeTreatUses) Registers that the given SqmFrom was used in an expression and whether to downgradeEntityNameUse.TREAT
of it.void
registerLockMode
(String identificationVariable, LockMode explicitLockMode) void
registerTreatedFrom
(SqmFrom<?, ?> sqmFrom) Registers that the given SqmFrom is treated.boolean
registerVisitedAssociationKey
(AssociationKey associationKey) Registers a circularity detection keyvoid
removeVisitedAssociationKey
(AssociationKey associationKey) Removes the registration of a circularity detection keyresolveModelPart
(NavigablePath navigablePath) Resolve the ModelPart associated with a given NavigablePath.void
setCurrentlyResolvingForeignKeyPart
(ForeignKeyDescriptor.Nature currentlyResolvingForeignKeySide) void
setResolvingCircularFetch
(boolean resolvingCircularFetch) visitFetches
(FetchParent fetchParent) Visit fetches for the given parent.<R> R
withNestedFetchParent
(FetchParent fetchParent, Function<FetchParent, R> action) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.sql.results.graph.DomainResultCreationState
getSqlAliasBaseManager, visitDiscriminatorFetch, visitEmbeddableDiscriminatorFetch, visitIdentifierFetch, visitNestedFetches
Methods inherited from interface org.hibernate.query.spi.QueryOptions
getCacheMode, getEffectiveLimit, getFirstRow, getMaxRows, getUniqueSemantic, hasLimit
Methods inherited from interface org.hibernate.sql.ast.spi.SqlAstCreationState
registerEntityNameUsage, supportsEntityNameUsage
Methods inherited from interface org.hibernate.sql.ast.spi.SqlAstProcessingState
isTopLevel
-
Constructor Details
-
LoaderSqlAstCreationState
public LoaderSqlAstCreationState(QueryPart queryPart, SqlAliasBaseManager sqlAliasBaseManager, FromClauseAccess fromClauseAccess, LockOptions lockOptions, LoaderSqlAstCreationState.FetchProcessor fetchProcessor, boolean forceIdentifierSelection, LoadQueryInfluencers loadQueryInfluencers, SqlAstCreationContext sf)
-
-
Method Details
-
applyOrdering
- Specified by:
applyOrdering
in interfaceSqlAstCreationState
-
getCreationContext
- Specified by:
getCreationContext
in interfaceSqlAstCreationState
-
getCurrentProcessingState
- Specified by:
getCurrentProcessingState
in interfaceSqlAstCreationState
-
getInflightQueryPart
Description copied from interface:SqlAstQueryPartProcessingState
Get the QueryPart being processed as part of this state. It is considered in-flight as it is probably still being built.- Specified by:
getInflightQueryPart
in interfaceSqlAstQueryPartProcessingState
-
getFromClause
Description copied from interface:SqlAstQueryNodeProcessingState
Returns the in-flight from clause for the query node.- Specified by:
getFromClause
in interfaceSqlAstQueryNodeProcessingState
-
applyPredicate
Description copied from interface:SqlAstQueryNodeProcessingState
Apply the predicate to be used for the final statement.- Specified by:
applyPredicate
in interfaceSqlAstQueryNodeProcessingState
-
registerTreatedFrom
Description copied from interface:SqlAstQueryNodeProcessingState
Registers that the given SqmFrom is treated.- Specified by:
registerTreatedFrom
in interfaceSqlAstQueryNodeProcessingState
-
registerFromUsage
Description copied from interface:SqlAstQueryNodeProcessingState
Registers that the given SqmFrom was used in an expression and whether to downgradeEntityNameUse.TREAT
of it.- Specified by:
registerFromUsage
in interfaceSqlAstQueryNodeProcessingState
-
getFromRegistrations
Description copied from interface:SqlAstQueryNodeProcessingState
Returns the treated SqmFroms and whether theirEntityNameUse.TREAT
should be downgraded toEntityNameUse.EXPRESSION
.- Specified by:
getFromRegistrations
in interfaceSqlAstQueryNodeProcessingState
-
getSqlExpressionResolver
- Specified by:
getSqlExpressionResolver
in interfaceSqlAstCreationState
- Specified by:
getSqlExpressionResolver
in interfaceSqlAstProcessingState
-
getFromClauseAccess
- Specified by:
getFromClauseAccess
in interfaceSqlAstCreationState
-
getSqlAliasBaseGenerator
- Specified by:
getSqlAliasBaseGenerator
in interfaceSqlAstCreationState
-
getLoadQueryInfluencers
- Specified by:
getLoadQueryInfluencers
in interfaceSqlAstCreationState
-
applyOnlyLoadByKeyFilters
public boolean applyOnlyLoadByKeyFilters()- Specified by:
applyOnlyLoadByKeyFilters
in interfaceSqlAstCreationState
-
registerLockMode
- Specified by:
registerLockMode
in interfaceSqlAstCreationState
-
visitFetches
Description copied from interface:DomainResultCreationState
Visit fetches for the given parent. We walk fetches via the SqlAstCreationContext because each "context" will define differently what should be fetched (HQL versus load)- Specified by:
visitFetches
in interfaceDomainResultCreationState
-
withNestedFetchParent
- Specified by:
withNestedFetchParent
in interfaceDomainResultCreationState
-
isResolvingCircularFetch
public boolean isResolvingCircularFetch()- Specified by:
isResolvingCircularFetch
in interfaceDomainResultCreationState
-
setResolvingCircularFetch
public void setResolvingCircularFetch(boolean resolvingCircularFetch) - Specified by:
setResolvingCircularFetch
in interfaceDomainResultCreationState
-
getCurrentlyResolvingForeignKeyPart
Description copied from interface:DomainResultCreationState
Returns the part of the foreign key that is currently being resolved, ornull
if no foreign key is currently being resolved.- Specified by:
getCurrentlyResolvingForeignKeyPart
in interfaceDomainResultCreationState
-
setCurrentlyResolvingForeignKeyPart
public void setCurrentlyResolvingForeignKeyPart(ForeignKeyDescriptor.Nature currentlyResolvingForeignKeySide) - Specified by:
setCurrentlyResolvingForeignKeyPart
in interfaceDomainResultCreationState
-
forceIdentifierSelection
public boolean forceIdentifierSelection()Description copied from interface:DomainResultCreationState
Whether forcing the selection of the identifier is in effect for this creation- Specified by:
forceIdentifierSelection
in interfaceDomainResultCreationState
-
getSqlAstCreationState
Description copied from interface:DomainResultCreationState
The underlying state for SQL AST creation- Specified by:
getSqlAstCreationState
in interfaceDomainResultCreationState
- Specified by:
getSqlAstCreationState
in interfaceSqlAstProcessingState
-
registerVisitedAssociationKey
Description copied from interface:DomainResultCreationState
Registers a circularity detection key- Specified by:
registerVisitedAssociationKey
in interfaceDomainResultCreationState
-
removeVisitedAssociationKey
Description copied from interface:DomainResultCreationState
Removes the registration of a circularity detection key- Specified by:
removeVisitedAssociationKey
in interfaceDomainResultCreationState
-
isAssociationKeyVisited
Description copied from interface:DomainResultCreationState
Checks whether the given circularityKey is registered- Specified by:
isAssociationKeyVisited
in interfaceDomainResultCreationState
-
isRegisteringVisitedAssociationKeys
public boolean isRegisteringVisitedAssociationKeys()Description copied from interface:DomainResultCreationState
Is this state accepting circularity detection keys?- Specified by:
isRegisteringVisitedAssociationKeys
in interfaceDomainResultCreationState
-
getParentState
- Specified by:
getParentState
in interfaceSqlAstProcessingState
-
getTimeout
Description copied from interface:QueryOptions
The timeout to apply to the query. May also be defined at the transaction level usingTransaction.getTimeout()
- Specified by:
getTimeout
in interfaceQueryOptions
-
getFlushMode
Description copied from interface:QueryOptions
The flush mode to use for the query execution- Specified by:
getFlushMode
in interfaceQueryOptions
-
isReadOnly
Description copied from interface:QueryOptions
Should entities returned from the query be marked read-only.- Specified by:
isReadOnly
in interfaceQueryOptions
-
getAppliedGraph
Description copied from interface:QueryOptions
JPAEntityGraph
explicitly applied to the query.- Specified by:
getAppliedGraph
in interfaceQueryOptions
-
getTupleTransformer
Description copied from interface:QueryOptions
Transformer applied to the query to transform the structure of each "row" in the results- Specified by:
getTupleTransformer
in interfaceQueryOptions
-
getResultListTransformer
Description copied from interface:QueryOptions
Transformer applied to the query to transform the structure of the overall results- Specified by:
getResultListTransformer
in interfaceQueryOptions
-
isResultCachingEnabled
Description copied from interface:QueryOptions
Should results from the query be cached?- Specified by:
isResultCachingEnabled
in interfaceQueryOptions
- See Also:
-
getQueryPlanCachingEnabled
Description copied from interface:QueryOptions
Should the query plan of the query be cached?- Specified by:
getQueryPlanCachingEnabled
in interfaceQueryOptions
-
getCacheRetrieveMode
Description copied from interface:QueryOptions
Controls whether query results are read from the cache. No effect unlessQueryOptions.isResultCachingEnabled()
returnstrue
- Specified by:
getCacheRetrieveMode
in interfaceQueryOptions
- See Also:
-
getCacheStoreMode
Description copied from interface:QueryOptions
Controls whether query results are put into the cache. No effect unlessQueryOptions.isResultCachingEnabled()
returnstrue
- Specified by:
getCacheStoreMode
in interfaceQueryOptions
- See Also:
-
getResultCacheRegionName
Description copied from interface:QueryOptions
The query cache region in which the results should be cached. No effect unlessQueryOptions.isResultCachingEnabled()
returnstrue
- Specified by:
getResultCacheRegionName
in interfaceQueryOptions
-
getLockOptions
Description copied from interface:QueryOptions
Describes the locking to apply to the query results- Specified by:
getLockOptions
in interfaceQueryOptions
-
getComment
Description copied from interface:QueryOptions
The SQL comment to apply to the interpreted SQL query, for dialects which support SQL comments- Specified by:
getComment
in interfaceQueryOptions
-
getDatabaseHints
Description copied from interface:QueryOptions
Hints to apply to the interpreted SQL query- Specified by:
getDatabaseHints
in interfaceQueryOptions
-
getFetchSize
Description copied from interface:QueryOptions
The fetch size to be applied to the JDBC query.- Specified by:
getFetchSize
in interfaceQueryOptions
- See Also:
-
getLimit
Description copied from interface:QueryOptions
The limit to the query results. May also be accessed viaQueryOptions.getFirstRow()
andQueryOptions.getMaxRows()
- Specified by:
getLimit
in interfaceQueryOptions
-
getEnabledFetchProfiles
Description copied from interface:QueryOptions
The explicitly enabled profiles for this query- Specified by:
getEnabledFetchProfiles
in interfaceQueryOptions
-
getDisabledFetchProfiles
Description copied from interface:QueryOptions
The explicitly disabled profiles for this query- Specified by:
getDisabledFetchProfiles
in interfaceQueryOptions
-