Top Description Fields Constructors Methods
org.hibernate.query.hql.internal

public Class SqmPathRegistryImpl

extends Object
implements SqmPathRegistry
Class Inheritance
All Implemented Interfaces
org.hibernate.query.hql.spi.SqmPathRegistry
Imports
java.util.ArrayList, .HashMap, .List, .Locale, .Map, java.util.function.Function, org.hibernate.jpa.spi.JpaCompliance, org.hibernate.metamodel.model.domain.BasicDomainType, org.hibernate.metamodel.model.domain.spi.JpaMetamodelImplementor, org.hibernate.query.hql.HqlLogging, org.hibernate.query.hql.spi.SqmCreationProcessingState, .SqmPathRegistry, org.hibernate.query.sqm.AliasCollisionException, .ParsingException, .SqmPathSource, .SqmTreeCreationLogger, org.hibernate.query.sqm.tree.domain.SqmPath, org.hibernate.query.sqm.tree.from.SqmCrossJoin, .SqmEntityJoin, .SqmFrom, .SqmRoot, org.hibernate.query.sqm.tree.select.SqmAliasedNode, .SqmSubQuery, org.hibernate.spi.NavigablePath, jakarta.persistence.criteria.Join, .Root

Container for indexing needed while building an SQM tree.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final SqmCreationProcessingState
private final JpaCompliance
private final List<SqmAliasedNode<?>>
private final Map<String, SqmFrom<?, ?>>
private final Map<NavigablePath, SqmFrom<?, ?>>
private final Map<NavigablePath, SqmPath<?>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
private boolean
definesAttribute(SqmPathSource<?> containerType, String name)

public SqmAliasedNode<?>
findAliasedNodeByAlias(String alias)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.findAliasedNodeByAlias.

Find a node (if one) by the explicit alias assigned to it within the select-clause
public SqmAliasedNode<?>
findAliasedNodeByPosition(int position)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.findAliasedNodeByPosition.

Find an SqmSelection by its position in the SqmSelectClause
public Integer
findAliasedNodePosition(String alias)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.findAliasedNodePosition.

Find the position of a node with the given alias, relative to the underlying SQL select-list.
public <X extends SqmFrom<?, ?>> X
findFromByAlias(String alias, boolean searchParent)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.findFromByAlias.

Find a SqmFrom by its identification variable (alias).
public <X extends SqmFrom<?, ?>> X
findFromByPath(NavigablePath navigablePath)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.findFromByPath.

Find a SqmFrom by its NavigablePath.
public <X extends SqmFrom<?, ?>> X
findFromExposing(String navigableName)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.findFromExposing.

Find a SqmFrom which exposes a Navigable by the given name.
private JpaMetamodelImplementor
public void
register(SqmPath<?> sqmPath)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.register.

Register an SqmPath
public void
register(SqmAliasedNode<?> node)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.register.

Register a node aliased within the select-clause
public <E> void
replace(SqmEntityJoin<E> sqmJoin, SqmRoot<E> sqmRoot)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.replace.

Used with JPA compliance to treat secondary query roots as cross-joins.
public <X extends SqmFrom<?, ?>> X
resolveFrom(NavigablePath navigablePath, Function<NavigablePath, SqmFrom<?, ?>> creator)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.resolveFrom.

Similar to findFromByPath, but accepting a producer to be used to create and register a SqmFrom if none yet registered.
public <X extends SqmFrom<?, ?>> X
resolveFrom(SqmPath<?> path)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.resolveFrom.

Similar to resolveFrom, but accepting a SqmPath to be used to create and register a SqmFrom if none yet registered.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

associatedProcessingStateback to summary
private final SqmCreationProcessingState associatedProcessingState
jpaComplianceback to summary
private final JpaCompliance jpaCompliance
simpleSelectionNodesback to summary
private final List<SqmAliasedNode<?>> simpleSelectionNodes
sqmFromByAliasback to summary
private final Map<String, SqmFrom<?, ?>> sqmFromByAlias
sqmFromByPathback to summary
private final Map<NavigablePath, SqmFrom<?, ?>> sqmFromByPath
sqmPathByPathback to summary
private final Map<NavigablePath, SqmPath<?>> sqmPathByPath

Constructor Detail

SqmPathRegistryImplback to summary
public SqmPathRegistryImpl(SqmCreationProcessingState associatedProcessingState)

Method Detail

checkResultVariableback to summary
private void checkResultVariable(SqmAliasedNode<?> selection)
definesAttributeback to summary
private boolean definesAttribute(SqmPathSource<?> containerType, String name)
findAliasedNodeByAliasback to summary
public SqmAliasedNode<?> findAliasedNodeByAlias(String alias)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.findAliasedNodeByAlias.

Doc from org.hibernate.query.hql.spi.SqmPathRegistry.findAliasedNodeByAlias.

Find a node (if one) by the explicit alias assigned to it within the select-clause

Returns:SqmAliasedNode<?>

The matching node, or null

Annotations
@Override
findAliasedNodeByPositionback to summary
public SqmAliasedNode<?> findAliasedNodeByPosition(int position)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.findAliasedNodeByPosition.

Doc from org.hibernate.query.hql.spi.SqmPathRegistry.findAliasedNodeByPosition.

Find an SqmSelection by its position in the SqmSelectClause

Returns:SqmAliasedNode<?>

The matching node, or null

Annotations
@Override
findAliasedNodePositionback to summary
public Integer findAliasedNodePosition(String alias)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.findAliasedNodePosition.

Doc from org.hibernate.query.hql.spi.SqmPathRegistry.findAliasedNodePosition.

Find the position of a node with the given alias, relative to the underlying SQL select-list.

Returns:Integer

The position, or null

Annotations
@Override
findFromByAliasback to summary
public <X extends SqmFrom<?, ?>> X findFromByAlias(String alias, boolean searchParent)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.findFromByAlias.

Doc from org.hibernate.query.hql.spi.SqmPathRegistry.findFromByAlias.

Find a SqmFrom by its identification variable (alias). If the SqmFrom is found in a parent context, the correlation for the path will be returned.

Returns:X

matching SqmFrom or null

Annotations
@Override
findFromByPathback to summary
public <X extends SqmFrom<?, ?>> X findFromByPath(NavigablePath navigablePath)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.findFromByPath.

Doc from org.hibernate.query.hql.spi.SqmPathRegistry.findFromByPath.

Find a SqmFrom by its NavigablePath. Will search any parent contexts as well

Returns:X

matching SqmFrom or null

Annotations
@Override
findFromExposingback to summary
public <X extends SqmFrom<?, ?>> X findFromExposing(String navigableName)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.findFromExposing.

Doc from org.hibernate.query.hql.spi.SqmPathRegistry.findFromExposing.

Find a SqmFrom which exposes a Navigable by the given name. Will search any parent contexts as well

Returns:X

matching SqmFrom or null

Annotations
@Override
getJpaMetamodelback to summary
private JpaMetamodelImplementor getJpaMetamodel()
registerback to summary
public void register(SqmPath<?> sqmPath)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.register.

Doc from org.hibernate.query.hql.spi.SqmPathRegistry.register.

Register an SqmPath

Annotations
@Override
registerback to summary
public void register(SqmAliasedNode<?> node)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.register.

Doc from org.hibernate.query.hql.spi.SqmPathRegistry.register.

Register a node aliased within the select-clause

Annotations
@Override
replaceback to summary
public <E> void replace(SqmEntityJoin<E> sqmJoin, SqmRoot<E> sqmRoot)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.replace.

Doc from org.hibernate.query.hql.spi.SqmPathRegistry.replace.

Used with JPA compliance to treat secondary query roots as cross-joins. Here we will replace the sqmRoot with the sqmJoin

Annotations
@Override
resolveFromback to summary
public <X extends SqmFrom<?, ?>> X resolveFrom(NavigablePath navigablePath, Function<NavigablePath, SqmFrom<?, ?>> creator)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.resolveFrom.

Doc from org.hibernate.query.hql.spi.SqmPathRegistry.resolveFrom.

Similar to findFromByPath, but accepting a producer to be used to create and register a SqmFrom if none yet registered.

Returns:X

The existing or just-created SqmFrom

Annotations
@Override
resolveFromback to summary
public <X extends SqmFrom<?, ?>> X resolveFrom(SqmPath<?> path)

Implements org.hibernate.query.hql.spi.SqmPathRegistry.resolveFrom.

Doc from org.hibernate.query.hql.spi.SqmPathRegistry.resolveFrom.

Similar to resolveFrom, but accepting a SqmPath to be used to create and register a SqmFrom if none yet registered.

Returns:X

The existing or just-created SqmFrom

Annotations
@Override