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 TypeMethodDescriptionbooleanvoidapplyOrdering(TableGroup tableGroup, OrderByFragment orderByFragment) voidapplyPredicate(Predicate predicate) Apply the predicate to be used for the final statement.booleanWhether forcing the selection of the identifier is in effect for this creationJPAEntityGraphexplicitly 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, ornullif 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.TREATshould 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 resultsbooleanisAssociationKeyVisited(AssociationKey associationKey) Checks whether the given circularityKey is registeredShould entities returned from the query be marked read-only.booleanIs this state accepting circularity detection keys?booleanShould results from the query be cached?voidregisterFromUsage(SqmFrom<?, ?> sqmFrom, boolean downgradeTreatUses) Registers that the given SqmFrom was used in an expression and whether to downgradeEntityNameUse.TREATof it.voidregisterLockMode(String identificationVariable, LockMode explicitLockMode) voidregisterTreatedFrom(SqmFrom<?, ?> sqmFrom) Registers that the given SqmFrom is treated.booleanregisterVisitedAssociationKey(AssociationKey associationKey) Registers a circularity detection keyvoidremoveVisitedAssociationKey(AssociationKey associationKey) Removes the registration of a circularity detection keyresolveModelPart(NavigablePath navigablePath) Resolve the ModelPart associated with a given NavigablePath.voidsetCurrentlyResolvingForeignKeyPart(ForeignKeyDescriptor.Nature currentlyResolvingForeignKeySide) voidsetResolvingCircularFetch(boolean resolvingCircularFetch) visitFetches(FetchParent fetchParent) Visit fetches for the given parent.<R> RwithNestedFetchParent(FetchParent fetchParent, Function<FetchParent, R> action) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.sql.results.graph.DomainResultCreationState
getSqlAliasBaseManager, visitDiscriminatorFetch, visitEmbeddableDiscriminatorFetch, visitIdentifierFetch, visitNestedFetchesMethods inherited from interface org.hibernate.query.spi.QueryOptions
getCacheMode, getEffectiveLimit, getFirstRow, getMaxRows, getUniqueSemantic, hasLimitMethods inherited from interface org.hibernate.sql.ast.spi.SqlAstCreationState
getSqmCreationContext, isProcedureOrNativeQuery, registerEntityNameUsage, supportsEntityNameUsageMethods 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:
applyOrderingin interfaceSqlAstCreationState
-
getCreationContext
- Specified by:
getCreationContextin interfaceSqlAstCreationState
-
getCurrentProcessingState
- Specified by:
getCurrentProcessingStatein interfaceSqlAstCreationState
-
getInflightQueryPart
Description copied from interface:SqlAstQueryPartProcessingStateGet the QueryPart being processed as part of this state. It is considered in-flight as it is probably still being built.- Specified by:
getInflightQueryPartin interfaceSqlAstQueryPartProcessingState
-
getFromClause
Description copied from interface:SqlAstQueryNodeProcessingStateReturns the in-flight from clause for the query node.- Specified by:
getFromClausein interfaceSqlAstQueryNodeProcessingState
-
applyPredicate
Description copied from interface:SqlAstQueryNodeProcessingStateApply the predicate to be used for the final statement.- Specified by:
applyPredicatein interfaceSqlAstQueryNodeProcessingState
-
registerTreatedFrom
Description copied from interface:SqlAstQueryNodeProcessingStateRegisters that the given SqmFrom is treated.- Specified by:
registerTreatedFromin interfaceSqlAstQueryNodeProcessingState
-
registerFromUsage
Description copied from interface:SqlAstQueryNodeProcessingStateRegisters that the given SqmFrom was used in an expression and whether to downgradeEntityNameUse.TREATof it.- Specified by:
registerFromUsagein interfaceSqlAstQueryNodeProcessingState
-
getFromRegistrations
Description copied from interface:SqlAstQueryNodeProcessingStateReturns the treated SqmFroms and whether theirEntityNameUse.TREATshould be downgraded toEntityNameUse.EXPRESSION.- Specified by:
getFromRegistrationsin interfaceSqlAstQueryNodeProcessingState
-
getSqlExpressionResolver
- Specified by:
getSqlExpressionResolverin interfaceSqlAstCreationState- Specified by:
getSqlExpressionResolverin interfaceSqlAstProcessingState
-
getFromClauseAccess
- Specified by:
getFromClauseAccessin interfaceSqlAstCreationState
-
getSqlAliasBaseGenerator
- Specified by:
getSqlAliasBaseGeneratorin interfaceSqlAstCreationState
-
getLoadQueryInfluencers
- Specified by:
getLoadQueryInfluencersin interfaceSqlAstCreationState
-
applyOnlyLoadByKeyFilters
public boolean applyOnlyLoadByKeyFilters()- Specified by:
applyOnlyLoadByKeyFiltersin interfaceSqlAstCreationState
-
registerLockMode
- Specified by:
registerLockModein interfaceSqlAstCreationState
-
visitFetches
Description copied from interface:DomainResultCreationStateVisit 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:
visitFetchesin interfaceDomainResultCreationState
-
withNestedFetchParent
- Specified by:
withNestedFetchParentin interfaceDomainResultCreationState
-
isResolvingCircularFetch
public boolean isResolvingCircularFetch()- Specified by:
isResolvingCircularFetchin interfaceDomainResultCreationState
-
setResolvingCircularFetch
public void setResolvingCircularFetch(boolean resolvingCircularFetch) - Specified by:
setResolvingCircularFetchin interfaceDomainResultCreationState
-
getCurrentlyResolvingForeignKeyPart
Description copied from interface:DomainResultCreationStateReturns the part of the foreign key that is currently being resolved, ornullif no foreign key is currently being resolved.- Specified by:
getCurrentlyResolvingForeignKeyPartin interfaceDomainResultCreationState
-
setCurrentlyResolvingForeignKeyPart
public void setCurrentlyResolvingForeignKeyPart(ForeignKeyDescriptor.Nature currentlyResolvingForeignKeySide) - Specified by:
setCurrentlyResolvingForeignKeyPartin interfaceDomainResultCreationState
-
forceIdentifierSelection
public boolean forceIdentifierSelection()Description copied from interface:DomainResultCreationStateWhether forcing the selection of the identifier is in effect for this creation- Specified by:
forceIdentifierSelectionin interfaceDomainResultCreationState
-
getSqlAstCreationState
Description copied from interface:DomainResultCreationStateThe underlying state for SQL AST creation- Specified by:
getSqlAstCreationStatein interfaceDomainResultCreationState- Specified by:
getSqlAstCreationStatein interfaceSqlAstProcessingState
-
registerVisitedAssociationKey
Description copied from interface:DomainResultCreationStateRegisters a circularity detection key- Specified by:
registerVisitedAssociationKeyin interfaceDomainResultCreationState
-
removeVisitedAssociationKey
Description copied from interface:DomainResultCreationStateRemoves the registration of a circularity detection key- Specified by:
removeVisitedAssociationKeyin interfaceDomainResultCreationState
-
isAssociationKeyVisited
Description copied from interface:DomainResultCreationStateChecks whether the given circularityKey is registered- Specified by:
isAssociationKeyVisitedin interfaceDomainResultCreationState
-
isRegisteringVisitedAssociationKeys
public boolean isRegisteringVisitedAssociationKeys()Description copied from interface:DomainResultCreationStateIs this state accepting circularity detection keys?- Specified by:
isRegisteringVisitedAssociationKeysin interfaceDomainResultCreationState
-
getParentState
- Specified by:
getParentStatein interfaceSqlAstProcessingState
-
getTimeout
Description copied from interface:QueryOptionsThe timeout to apply to the query. May also be defined at the transaction level usingTransaction.getTimeout()- Specified by:
getTimeoutin interfaceQueryOptions
-
getFlushMode
Description copied from interface:QueryOptionsThe flush mode to use for the query execution- Specified by:
getFlushModein interfaceQueryOptions
-
isReadOnly
Description copied from interface:QueryOptionsShould entities returned from the query be marked read-only.- Specified by:
isReadOnlyin interfaceQueryOptions
-
getAppliedGraph
Description copied from interface:QueryOptionsJPAEntityGraphexplicitly applied to the query.- Specified by:
getAppliedGraphin interfaceQueryOptions
-
getTupleTransformer
Description copied from interface:QueryOptionsTransformer applied to the query to transform the structure of each "row" in the results- Specified by:
getTupleTransformerin interfaceQueryOptions
-
getResultListTransformer
Description copied from interface:QueryOptionsTransformer applied to the query to transform the structure of the overall results- Specified by:
getResultListTransformerin interfaceQueryOptions
-
isResultCachingEnabled
Description copied from interface:QueryOptionsShould results from the query be cached?- Specified by:
isResultCachingEnabledin interfaceQueryOptions- See Also:
-
getQueryPlanCachingEnabled
Description copied from interface:QueryOptionsShould the query plan of the query be cached?- Specified by:
getQueryPlanCachingEnabledin interfaceQueryOptions
-
getCacheRetrieveMode
Description copied from interface:QueryOptionsControls whether query results are read from the cache. No effect unlessQueryOptions.isResultCachingEnabled()returnstrue- Specified by:
getCacheRetrieveModein interfaceQueryOptions- See Also:
-
getCacheStoreMode
Description copied from interface:QueryOptionsControls whether query results are put into the cache. No effect unlessQueryOptions.isResultCachingEnabled()returnstrue- Specified by:
getCacheStoreModein interfaceQueryOptions- See Also:
-
getResultCacheRegionName
Description copied from interface:QueryOptionsThe query cache region in which the results should be cached. No effect unlessQueryOptions.isResultCachingEnabled()returnstrue- Specified by:
getResultCacheRegionNamein interfaceQueryOptions
-
getLockOptions
Description copied from interface:QueryOptionsDescribes the locking to apply to the query results- Specified by:
getLockOptionsin interfaceQueryOptions
-
getComment
Description copied from interface:QueryOptionsThe SQL comment to apply to the interpreted SQL query, for dialects which support SQL comments- Specified by:
getCommentin interfaceQueryOptions
-
getDatabaseHints
Description copied from interface:QueryOptionsHints to apply to the interpreted SQL query- Specified by:
getDatabaseHintsin interfaceQueryOptions
-
getFetchSize
Description copied from interface:QueryOptionsThe fetch size to be applied to the JDBC query.- Specified by:
getFetchSizein interfaceQueryOptions- See Also:
-
getLimit
Description copied from interface:QueryOptionsThe limit to the query results. May also be accessed viaQueryOptions.getFirstRow()andQueryOptions.getMaxRows()- Specified by:
getLimitin interfaceQueryOptions
-
getEnabledFetchProfiles
Description copied from interface:QueryOptionsThe explicitly enabled profiles for this query- Specified by:
getEnabledFetchProfilesin interfaceQueryOptions
-
getDisabledFetchProfiles
Description copied from interface:QueryOptionsThe explicitly disabled profiles for this query- Specified by:
getDisabledFetchProfilesin interfaceQueryOptions
-