Package org.hibernate.query.hql.internal
Class SqmPathRegistryImpl
- java.lang.Object
-
- org.hibernate.query.hql.internal.SqmPathRegistryImpl
-
- All Implemented Interfaces:
SqmPathRegistry
public class SqmPathRegistryImpl extends Object implements SqmPathRegistry
Container for indexing needed while building an SQM tree.
-
-
Constructor Summary
Constructors Constructor Description SqmPathRegistryImpl(SqmCreationProcessingState associatedProcessingState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SqmAliasedNode<?>findAliasedNodeByAlias(String alias)Find a node (if one) by the explicit alias assigned to it within the select-clauseSqmAliasedNode<?>findAliasedNodeByPosition(int position)Find an SqmSelection by its position in the SqmSelectClauseIntegerfindAliasedNodePosition(String alias)Find the position of a node with the given alias, relative to the underlying SQL select-list.<X extends SqmFrom<?,?>>
XfindFromByAlias(String alias, boolean searchParent)Find a SqmFrom by its identification variable (alias).<X extends SqmFrom<?,?>>
XfindFromByPath(NavigablePath navigablePath)Find a SqmFrom by its NavigablePath.<X extends SqmFrom<?,?>>
XfindFromExposing(String navigableName)Find a SqmFrom which exposes a Navigable by the given name.voidregister(SqmPath<?> sqmPath)Register an SqmPathvoidregister(SqmAliasedNode<?> node)Register a node aliased within the select-clause<X extends SqmFrom<?,?>>
XresolveFrom(SqmPath<?> path)Similar toSqmPathRegistry.resolveFrom(org.hibernate.spi.NavigablePath, java.util.function.Function<org.hibernate.spi.NavigablePath, org.hibernate.query.sqm.tree.from.SqmFrom<?, ?>>), but accepting a SqmPath to be used to create and register a SqmFrom if none yet registered.<X extends SqmFrom<?,?>>
XresolveFrom(NavigablePath navigablePath, Function<NavigablePath,SqmFrom<?,?>> creator)Similar toSqmPathRegistry.findFromByPath(org.hibernate.spi.NavigablePath), but accepting a producer to be used to create and register a SqmFrom if none yet registered.
-
-
-
Constructor Detail
-
SqmPathRegistryImpl
public SqmPathRegistryImpl(SqmCreationProcessingState associatedProcessingState)
-
-
Method Detail
-
register
public void register(SqmPath<?> sqmPath)
Description copied from interface:SqmPathRegistryRegister an SqmPath- Specified by:
registerin interfaceSqmPathRegistry
-
findFromByPath
public <X extends SqmFrom<?,?>> X findFromByPath(NavigablePath navigablePath)
Description copied from interface:SqmPathRegistryFind a SqmFrom by its NavigablePath. Will search any parent contexts as well- Specified by:
findFromByPathin interfaceSqmPathRegistry- Returns:
- matching SqmFrom or
null
-
findFromByAlias
public <X extends SqmFrom<?,?>> X findFromByAlias(String alias, boolean searchParent)
Description copied from interface:SqmPathRegistryFind a SqmFrom by its identification variable (alias). If the SqmFrom is found in a parent context, the correlation for the path will be returned.- Specified by:
findFromByAliasin interfaceSqmPathRegistry- Returns:
- matching SqmFrom or
null
-
findFromExposing
public <X extends SqmFrom<?,?>> X findFromExposing(String navigableName)
Description copied from interface:SqmPathRegistryFind a SqmFrom which exposes a Navigable by the given name. Will search any parent contexts as well- Specified by:
findFromExposingin interfaceSqmPathRegistry- Returns:
- matching SqmFrom or
null
-
resolveFrom
public <X extends SqmFrom<?,?>> X resolveFrom(NavigablePath navigablePath, Function<NavigablePath,SqmFrom<?,?>> creator)
Description copied from interface:SqmPathRegistrySimilar toSqmPathRegistry.findFromByPath(org.hibernate.spi.NavigablePath), but accepting a producer to be used to create and register a SqmFrom if none yet registered.- Specified by:
resolveFromin interfaceSqmPathRegistry- Returns:
- The existing or just-created SqmFrom
-
resolveFrom
public <X extends SqmFrom<?,?>> X resolveFrom(SqmPath<?> path)
Description copied from interface:SqmPathRegistrySimilar toSqmPathRegistry.resolveFrom(org.hibernate.spi.NavigablePath, java.util.function.Function<org.hibernate.spi.NavigablePath, org.hibernate.query.sqm.tree.from.SqmFrom<?, ?>>), but accepting a SqmPath to be used to create and register a SqmFrom if none yet registered.- Specified by:
resolveFromin interfaceSqmPathRegistry- Returns:
- The existing or just-created SqmFrom
-
findAliasedNodeByAlias
public SqmAliasedNode<?> findAliasedNodeByAlias(String alias)
Description copied from interface:SqmPathRegistryFind a node (if one) by the explicit alias assigned to it within the select-clause- Specified by:
findAliasedNodeByAliasin interfaceSqmPathRegistry- Returns:
- The matching node, or null
-
findAliasedNodePosition
public Integer findAliasedNodePosition(String alias)
Description copied from interface:SqmPathRegistryFind the position of a node with the given alias, relative to the underlying SQL select-list.- Specified by:
findAliasedNodePositionin interfaceSqmPathRegistry- Returns:
- The position, or null
-
findAliasedNodeByPosition
public SqmAliasedNode<?> findAliasedNodeByPosition(int position)
Description copied from interface:SqmPathRegistryFind an SqmSelection by its position in the SqmSelectClause- Specified by:
findAliasedNodeByPositionin interfaceSqmPathRegistry- Returns:
- The matching node, or null
-
register
public void register(SqmAliasedNode<?> node)
Description copied from interface:SqmPathRegistryRegister a node aliased within the select-clause- Specified by:
registerin interfaceSqmPathRegistry
-
-