Top Description Inners Fields Constructors Methods
org.hibernate.loader.ast.internal

public Class LoaderSqlAstCreationState

extends Object
implements SqlAstQueryPartProcessingState, SqlAstCreationState, DomainResultCreationState, QueryOptions
Class Inheritance
All Implemented Interfaces
org.hibernate.query.spi.QueryOptions, org.hibernate.sql.results.graph.DomainResultCreationState, org.hibernate.sql.ast.spi.SqlAstCreationState, org.hibernate.sql.ast.spi.SqlAstQueryPartProcessingState, org.hibernate.sql.ast.spi.SqlAstProcessingState
Imports
java.util.Collections, .HashSet, .List, .Map, .Set, jakarta.persistence.CacheRetrieveMode, .CacheStoreMode, org.hibernate.FlushMode, .LockMode, .LockOptions, org.hibernate.engine.spi.LoadQueryInfluencers, org.hibernate.graph.spi.AppliedGraph, org.hibernate.metamodel.mapping.AssociationKey, .ForeignKeyDescriptor, .ModelPart, org.hibernate.query.spi.Limit, .QueryOptions, org.hibernate.query.sqm.tree.from.SqmFrom, org.hibernate.spi.NavigablePath, org.hibernate.query.ResultListTransformer, .TupleTransformer, org.hibernate.query.sqm.sql.internal.SqlAstQueryPartProcessingStateImpl, org.hibernate.sql.ast.Clause, org.hibernate.sql.ast.spi.FromClauseAccess, .SqlAliasBaseGenerator, .SqlAliasBaseManager, .SqlAstCreationContext, .SqlAstCreationState, .SqlAstProcessingState, .SqlAstQueryPartProcessingState, .SqlExpressionResolver, org.hibernate.sql.ast.tree.select.QueryPart, org.hibernate.sql.results.graph.DomainResultCreationState, .FetchParent, org.hibernate.sql.results.graph.internal.ImmutableFetchList

Helper used when generating the database-snapshot select query

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Field Summary

Modifier and TypeField and Description
private ForeignKeyDescriptor.Nature
private final LoaderSqlAstCreationState.FetchProcessor
private final boolean
private final FromClauseAccess
private final LoadQueryInfluencers
private final LockOptions
private final SqlAstQueryPartProcessingStateImpl
private boolean
private final SqlAstCreationContext
private final SqlAliasBaseManager
private final Set<AssociationKey>

Constructor Summary

AccessConstructor and Description
public
LoaderSqlAstCreationState(QueryPart queryPart, SqlAliasBaseManager sqlAliasBaseManager, FromClauseAccess fromClauseAccess, LockOptions lockOptions, LoaderSqlAstCreationState.FetchProcessor fetchProcessor, boolean forceIdentifierSelection, LoadQueryInfluencers loadQueryInfluencers, SqlAstCreationContext sf)

Method Summary

Modifier and TypeMethod and Description
public boolean
forceIdentifierSelection()

Overrides default org.hibernate.sql.results.graph.DomainResultCreationState.forceIdentifierSelection.

Whether forcing the selection of the identifier is in effect for this creation
public AppliedGraph
public CacheRetrieveMode
getCacheRetrieveMode()

Implements org.hibernate.query.spi.QueryOptions.getCacheRetrieveMode.

Controls whether query results are read from the cache.
public CacheStoreMode
getCacheStoreMode()

Implements org.hibernate.query.spi.QueryOptions.getCacheStoreMode.

Controls whether query results are put into the cache.
public String
getComment()

Implements org.hibernate.query.spi.QueryOptions.getComment.

The SQL comment to apply to the interpreted SQL query, for dialects which support SQL comments
public SqlAstCreationContext
public ForeignKeyDescriptor.Nature
getCurrentlyResolvingForeignKeyPart()

Implements org.hibernate.sql.results.graph.DomainResultCreationState.getCurrentlyResolvingForeignKeyPart.

Returns the part of the foreign key that is currently being resolved, or null if no foreign key is currently being resolved.
public SqlAstProcessingState
public List<String>
getDatabaseHints()

Implements org.hibernate.query.spi.QueryOptions.getDatabaseHints.

Hints to apply to the interpreted SQL query
public Set<String>
getDisabledFetchProfiles()

Implements org.hibernate.query.spi.QueryOptions.getDisabledFetchProfiles.

The explicitly disabled profiles for this query
public Set<String>
getEnabledFetchProfiles()

Implements org.hibernate.query.spi.QueryOptions.getEnabledFetchProfiles.

The explicitly enabled profiles for this query
public Integer
getFetchSize()

Implements org.hibernate.query.spi.QueryOptions.getFetchSize.

The fetch size to be applied to the JDBC query.
public FlushMode
getFlushMode()

Implements org.hibernate.query.spi.QueryOptions.getFlushMode.

The flush mode to use for the query execution
public FromClauseAccess
public Map<SqmFrom<?, ?>, Boolean>
public QueryPart
getInflightQueryPart()

Implements org.hibernate.sql.ast.spi.SqlAstQueryPartProcessingState.getInflightQueryPart.

Get the QueryPart being processed as part of this state.
public Limit
getLimit()

Implements org.hibernate.query.spi.QueryOptions.getLimit.

The limit to the query results.
public LoadQueryInfluencers
public LockOptions
getLockOptions()

Implements org.hibernate.query.spi.QueryOptions.getLockOptions.

Describes the locking to apply to the query results
public SqlAstProcessingState
public Boolean
getQueryPlanCachingEnabled()

Implements org.hibernate.query.spi.QueryOptions.getQueryPlanCachingEnabled.

Should the query plan of the query be cached?
public String
getResultCacheRegionName()

Implements org.hibernate.query.spi.QueryOptions.getResultCacheRegionName.

The query cache region in which the results should be cached.
public ResultListTransformer<?>
getResultListTransformer()

Implements org.hibernate.query.spi.QueryOptions.getResultListTransformer.

Transformer applied to the query to transform the structure of the overall results
public SqlAliasBaseGenerator
public SqlAstCreationState
public SqlExpressionResolver
public Integer
getTimeout()

Implements org.hibernate.query.spi.QueryOptions.getTimeout.

The timeout to apply to the query.
public TupleTransformer<?>
getTupleTransformer()

Implements org.hibernate.query.spi.QueryOptions.getTupleTransformer.

Transformer applied to the query to transform the structure of each "row" in the results
public boolean
isAssociationKeyVisited(AssociationKey associationKey)

Overrides default org.hibernate.sql.results.graph.DomainResultCreationState.isAssociationKeyVisited.

Checks whether the given circularityKey is registered
public Boolean
isReadOnly()

Implements org.hibernate.query.spi.QueryOptions.isReadOnly.

Should entities returned from the query be marked read-only.
public boolean
public boolean
public Boolean
isResultCachingEnabled()

Implements org.hibernate.query.spi.QueryOptions.isResultCachingEnabled.

Should results from the query be cached?
public void
registerFromUsage(SqmFrom<?, ?> sqmFrom, boolean downgradeTreatUses)

Implements org.hibernate.sql.ast.spi.SqlAstQueryPartProcessingState.registerFromUsage.

Registers that the given SqmFrom was used in an expression and whether to downgrade org.hibernate.persister.entity.EntityNameUse#TREAT of it.
public void
public void
registerTreatedFrom(SqmFrom<?, ?> sqmFrom)

Implements org.hibernate.sql.ast.spi.SqlAstQueryPartProcessingState.registerTreatedFrom.

Registers that the given SqmFrom is treated.
public boolean
public void
removeVisitedAssociationKey(AssociationKey associationKey)

Overrides default org.hibernate.sql.results.graph.DomainResultCreationState.removeVisitedAssociationKey.

Removes the registration of a circularity detection key
public ModelPart
resolveModelPart(NavigablePath navigablePath)

Implements org.hibernate.sql.results.graph.DomainResultCreationState.resolveModelPart.

Resolve the ModelPart associated with a given NavigablePath.
public void
public void
public ImmutableFetchList
visitFetches(FetchParent fetchParent)

Implements org.hibernate.sql.results.graph.DomainResultCreationState.visitFetches.

Visit fetches for the given parent.
public ImmutableFetchList
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentlyResolvingForeignKeySideback to summary
private ForeignKeyDescriptor.Nature currentlyResolvingForeignKeySide
fetchProcessorback to summary
private final LoaderSqlAstCreationState.FetchProcessor fetchProcessor
forceIdentifierSelectionback to summary
private final boolean forceIdentifierSelection
fromClauseAccessback to summary
private final FromClauseAccess fromClauseAccess
loadQueryInfluencersback to summary
private final LoadQueryInfluencers loadQueryInfluencers
lockOptionsback to summary
private final LockOptions lockOptions
processingStateback to summary
private final SqlAstQueryPartProcessingStateImpl processingState
resolvingCircularFetchback to summary
private boolean resolvingCircularFetch
sfback to summary
private final SqlAstCreationContext sf
sqlAliasBaseManagerback to summary
private final SqlAliasBaseManager sqlAliasBaseManager
visitedAssociationKeysback to summary
private final Set<AssociationKey> visitedAssociationKeys

Constructor Detail

LoaderSqlAstCreationStateback to summary
public LoaderSqlAstCreationState(QueryPart queryPart, SqlAliasBaseManager sqlAliasBaseManager, FromClauseAccess fromClauseAccess, LockOptions lockOptions, LoaderSqlAstCreationState.FetchProcessor fetchProcessor, boolean forceIdentifierSelection, LoadQueryInfluencers loadQueryInfluencers, SqlAstCreationContext sf)

Method Detail

forceIdentifierSelectionback to summary
public boolean forceIdentifierSelection()

Overrides default org.hibernate.sql.results.graph.DomainResultCreationState.forceIdentifierSelection.

Doc from org.hibernate.sql.results.graph.DomainResultCreationState.forceIdentifierSelection.

Whether forcing the selection of the identifier is in effect for this creation

Annotations
@Override
getAppliedGraphback to summary
public AppliedGraph getAppliedGraph()

Implements org.hibernate.query.spi.QueryOptions.getAppliedGraph.

Doc from org.hibernate.query.spi.QueryOptions.getAppliedGraph.

JPA jakarta.persistence.EntityGraph explicitly applied to the query.

Annotations
@Override
getCacheRetrieveModeback to summary
public CacheRetrieveMode getCacheRetrieveMode()

Implements org.hibernate.query.spi.QueryOptions.getCacheRetrieveMode.

Doc from org.hibernate.query.spi.QueryOptions.getCacheRetrieveMode.

Controls whether query results are read from the cache. No effect unless isResultCachingEnabled returns true

Annotations
@Override
getCacheStoreModeback to summary
public CacheStoreMode getCacheStoreMode()

Implements org.hibernate.query.spi.QueryOptions.getCacheStoreMode.

Doc from org.hibernate.query.spi.QueryOptions.getCacheStoreMode.

Controls whether query results are put into the cache. No effect unless isResultCachingEnabled returns true

Annotations
@Override
getCommentback to summary
public String getComment()

Implements org.hibernate.query.spi.QueryOptions.getComment.

Doc from org.hibernate.query.spi.QueryOptions.getComment.

The SQL comment to apply to the interpreted SQL query, for dialects which support SQL comments

Annotations
@Override
getCreationContextback to summary
public SqlAstCreationContext getCreationContext()

Implements org.hibernate.sql.ast.spi.SqlAstCreationState.getCreationContext.

Annotations
@Override
getCurrentlyResolvingForeignKeyPartback to summary
public ForeignKeyDescriptor.Nature getCurrentlyResolvingForeignKeyPart()

Implements org.hibernate.sql.results.graph.DomainResultCreationState.getCurrentlyResolvingForeignKeyPart.

Doc from org.hibernate.sql.results.graph.DomainResultCreationState.getCurrentlyResolvingForeignKeyPart.

Returns the part of the foreign key that is currently being resolved, or null if no foreign key is currently being resolved.

Annotations
@Override
getCurrentProcessingStateback to summary
public SqlAstProcessingState getCurrentProcessingState()

Implements org.hibernate.sql.ast.spi.SqlAstCreationState.getCurrentProcessingState.

Annotations
@Override
getDatabaseHintsback to summary
public List<String> getDatabaseHints()

Implements org.hibernate.query.spi.QueryOptions.getDatabaseHints.

Doc from org.hibernate.query.spi.QueryOptions.getDatabaseHints.

Hints to apply to the interpreted SQL query

Annotations
@Override
getDisabledFetchProfilesback to summary
public Set<String> getDisabledFetchProfiles()

Implements org.hibernate.query.spi.QueryOptions.getDisabledFetchProfiles.

Doc from org.hibernate.query.spi.QueryOptions.getDisabledFetchProfiles.

The explicitly disabled profiles for this query

Annotations
@Override
getEnabledFetchProfilesback to summary
public Set<String> getEnabledFetchProfiles()

Implements org.hibernate.query.spi.QueryOptions.getEnabledFetchProfiles.

Doc from org.hibernate.query.spi.QueryOptions.getEnabledFetchProfiles.

The explicitly enabled profiles for this query

Annotations
@Override
getFetchSizeback to summary
public Integer getFetchSize()

Implements org.hibernate.query.spi.QueryOptions.getFetchSize.

Doc from org.hibernate.query.spi.QueryOptions.getFetchSize.

The fetch size to be applied to the JDBC query.

Annotations
@Override
getFlushModeback to summary
public FlushMode getFlushMode()

Implements org.hibernate.query.spi.QueryOptions.getFlushMode.

Doc from org.hibernate.query.spi.QueryOptions.getFlushMode.

The flush mode to use for the query execution

Annotations
@Override
getFromClauseAccessback to summary
public FromClauseAccess getFromClauseAccess()

Implements org.hibernate.sql.ast.spi.SqlAstCreationState.getFromClauseAccess.

Annotations
@Override
getFromRegistrationsback to summary
public Map<SqmFrom<?, ?>, Boolean> getFromRegistrations()

Implements org.hibernate.sql.ast.spi.SqlAstQueryPartProcessingState.getFromRegistrations.

Doc from org.hibernate.sql.ast.spi.SqlAstQueryPartProcessingState.getFromRegistrations.

Returns the treated SqmFroms and whether their org.hibernate.persister.entity.EntityNameUse#TREAT should be downgraded to org.hibernate.persister.entity.EntityNameUse#EXPRESSION.

Annotations
@Override
getInflightQueryPartback to summary
public QueryPart getInflightQueryPart()

Implements org.hibernate.sql.ast.spi.SqlAstQueryPartProcessingState.getInflightQueryPart.

Doc from org.hibernate.sql.ast.spi.SqlAstQueryPartProcessingState.getInflightQueryPart.

Get the QueryPart being processed as part of this state. It is considered in-flight as it is probably still being built.

Annotations
@Override
getLimitback to summary
public Limit getLimit()

Implements org.hibernate.query.spi.QueryOptions.getLimit.

Doc from org.hibernate.query.spi.QueryOptions.getLimit.

The limit to the query results. May also be accessed via getFirstRow and getMaxRows

Annotations
@Override
getLoadQueryInfluencersback to summary
public LoadQueryInfluencers getLoadQueryInfluencers()

Implements org.hibernate.sql.ast.spi.SqlAstCreationState.getLoadQueryInfluencers.

Annotations
@Override
getLockOptionsback to summary
public LockOptions getLockOptions()

Implements org.hibernate.query.spi.QueryOptions.getLockOptions.

Doc from org.hibernate.query.spi.QueryOptions.getLockOptions.

Describes the locking to apply to the query results

Annotations
@Override
getParentStateback to summary
public SqlAstProcessingState getParentState()

Implements org.hibernate.sql.ast.spi.SqlAstProcessingState.getParentState.

Annotations
@Override
getQueryPlanCachingEnabledback to summary
public Boolean getQueryPlanCachingEnabled()

Implements org.hibernate.query.spi.QueryOptions.getQueryPlanCachingEnabled.

Doc from org.hibernate.query.spi.QueryOptions.getQueryPlanCachingEnabled.

Should the query plan of the query be cached?

Annotations
@Override
getResultCacheRegionNameback to summary
public String getResultCacheRegionName()

Implements org.hibernate.query.spi.QueryOptions.getResultCacheRegionName.

Doc from org.hibernate.query.spi.QueryOptions.getResultCacheRegionName.

The query cache region in which the results should be cached. No effect unless isResultCachingEnabled returns true

Annotations
@Override
getResultListTransformerback to summary
public ResultListTransformer<?> getResultListTransformer()

Implements org.hibernate.query.spi.QueryOptions.getResultListTransformer.

Doc from org.hibernate.query.spi.QueryOptions.getResultListTransformer.

Transformer applied to the query to transform the structure of the overall results

Annotations
@Override
getSqlAliasBaseGeneratorback to summary
public SqlAliasBaseGenerator getSqlAliasBaseGenerator()

Implements org.hibernate.sql.ast.spi.SqlAstCreationState.getSqlAliasBaseGenerator.

Annotations
@Override
getSqlAstCreationStateback to summary
public SqlAstCreationState getSqlAstCreationState()

Implements org.hibernate.sql.ast.spi.SqlAstProcessingState.getSqlAstCreationState, org.hibernate.sql.results.graph.DomainResultCreationState.getSqlAstCreationState.

Doc from org.hibernate.sql.results.graph.DomainResultCreationState.getSqlAstCreationState.

The underlying state for SQL AST creation

Annotations
@Override
getSqlExpressionResolverback to summary
public SqlExpressionResolver getSqlExpressionResolver()

Implements org.hibernate.sql.ast.spi.SqlAstProcessingState.getSqlExpressionResolver, org.hibernate.sql.ast.spi.SqlAstCreationState.getSqlExpressionResolver.

Annotations
@Override
getTimeoutback to summary
public Integer getTimeout()

Implements org.hibernate.query.spi.QueryOptions.getTimeout.

Doc from org.hibernate.query.spi.QueryOptions.getTimeout.

The timeout to apply to the query. May also be defined at the transaction level using org.hibernate.Transaction#getTimeout

Annotations
@Override
getTupleTransformerback to summary
public TupleTransformer<?> getTupleTransformer()

Implements org.hibernate.query.spi.QueryOptions.getTupleTransformer.

Doc from org.hibernate.query.spi.QueryOptions.getTupleTransformer.

Transformer applied to the query to transform the structure of each "row" in the results

Annotations
@Override
isAssociationKeyVisitedback to summary
public boolean isAssociationKeyVisited(AssociationKey associationKey)

Overrides default org.hibernate.sql.results.graph.DomainResultCreationState.isAssociationKeyVisited.

Doc from org.hibernate.sql.results.graph.DomainResultCreationState.isAssociationKeyVisited.

Checks whether the given circularityKey is registered

Annotations
@Override
isReadOnlyback to summary
public Boolean isReadOnly()

Implements org.hibernate.query.spi.QueryOptions.isReadOnly.

Doc from org.hibernate.query.spi.QueryOptions.isReadOnly.

Should entities returned from the query be marked read-only.

Annotations
@Override
isRegisteringVisitedAssociationKeysback to summary
public boolean isRegisteringVisitedAssociationKeys()

Overrides default org.hibernate.sql.results.graph.DomainResultCreationState.isRegisteringVisitedAssociationKeys.

Doc from org.hibernate.sql.results.graph.DomainResultCreationState.isRegisteringVisitedAssociationKeys.

Is this state accepting circularity detection keys?

Annotations
@Override
isResolvingCircularFetchback to summary
public boolean isResolvingCircularFetch()

Implements org.hibernate.sql.results.graph.DomainResultCreationState.isResolvingCircularFetch.

Annotations
@Override
isResultCachingEnabledback to summary
public Boolean isResultCachingEnabled()

Implements org.hibernate.query.spi.QueryOptions.isResultCachingEnabled.

Doc from org.hibernate.query.spi.QueryOptions.isResultCachingEnabled.

Should results from the query be cached?

Annotations
@Override
registerFromUsageback to summary
public void registerFromUsage(SqmFrom<?, ?> sqmFrom, boolean downgradeTreatUses)

Implements org.hibernate.sql.ast.spi.SqlAstQueryPartProcessingState.registerFromUsage.

Doc from org.hibernate.sql.ast.spi.SqlAstQueryPartProcessingState.registerFromUsage.

Registers that the given SqmFrom was used in an expression and whether to downgrade org.hibernate.persister.entity.EntityNameUse#TREAT of it.

Annotations
@Override
registerLockModeback to summary
public void registerLockMode(String identificationVariable, LockMode explicitLockMode)

Implements org.hibernate.sql.ast.spi.SqlAstCreationState.registerLockMode.

Annotations
@Override
registerTreatedFromback to summary
public void registerTreatedFrom(SqmFrom<?, ?> sqmFrom)

Implements org.hibernate.sql.ast.spi.SqlAstQueryPartProcessingState.registerTreatedFrom.

Doc from org.hibernate.sql.ast.spi.SqlAstQueryPartProcessingState.registerTreatedFrom.

Registers that the given SqmFrom is treated.

Annotations
@Override
registerVisitedAssociationKeyback to summary
public boolean registerVisitedAssociationKey(AssociationKey associationKey)

Overrides default org.hibernate.sql.results.graph.DomainResultCreationState.registerVisitedAssociationKey.

Doc from org.hibernate.sql.results.graph.DomainResultCreationState.registerVisitedAssociationKey.

Registers a circularity detection key

Annotations
@Override
removeVisitedAssociationKeyback to summary
public void removeVisitedAssociationKey(AssociationKey associationKey)

Overrides default org.hibernate.sql.results.graph.DomainResultCreationState.removeVisitedAssociationKey.

Doc from org.hibernate.sql.results.graph.DomainResultCreationState.removeVisitedAssociationKey.

Removes the registration of a circularity detection key

Annotations
@Override
resolveModelPartback to summary
public ModelPart resolveModelPart(NavigablePath navigablePath)

Implements org.hibernate.sql.results.graph.DomainResultCreationState.resolveModelPart.

Doc from org.hibernate.sql.results.graph.DomainResultCreationState.resolveModelPart.

Resolve the ModelPart associated with a given NavigablePath. More specific ModelParts should be preferred - e.g. the SingularAssociationAttributeMapping rather than just the EntityTypeMapping for the associated type

Annotations
@Override
setCurrentlyResolvingForeignKeyPartback to summary
public void setCurrentlyResolvingForeignKeyPart(ForeignKeyDescriptor.Nature currentlyResolvingForeignKeySide)

Implements org.hibernate.sql.results.graph.DomainResultCreationState.setCurrentlyResolvingForeignKeyPart.

Annotations
@Override
setResolvingCircularFetchback to summary
public void setResolvingCircularFetch(boolean resolvingCircularFetch)

Implements org.hibernate.sql.results.graph.DomainResultCreationState.setResolvingCircularFetch.

Annotations
@Override
visitFetchesback to summary
public ImmutableFetchList visitFetches(FetchParent fetchParent)

Implements org.hibernate.sql.results.graph.DomainResultCreationState.visitFetches.

Doc from org.hibernate.sql.results.graph.DomainResultCreationState.visitFetches.

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)

Annotations
@Override
visitNestedFetchesback to summary
public ImmutableFetchList visitNestedFetches(FetchParent fetchParent)

Implements org.hibernate.sql.results.graph.DomainResultCreationState.visitNestedFetches.

Annotations
@Override
org.hibernate.loader.ast.internal back to summary

public Interface LoaderSqlAstCreationState.FetchProcessor


Method Summary

Modifier and TypeMethod and Description
public ImmutableFetchList

Method Detail

visitFetchesback to summary
public ImmutableFetchList visitFetches(FetchParent fetchParent, LoaderSqlAstCreationState creationState)