Package org.hibernate.query.hql.spi
Interface SqmPathRegistry
-
- All Known Implementing Classes:
SqmPathRegistryImpl
@Incubating public interface SqmPathRegistry
Registry for SqmPath references providing the ability to access them in multiple ways - by alias, by NavigablePath, etc
-
-
Method Summary
All Methods Instance Methods Abstract 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 SqmSelectClauseInteger
findAliasedNodePosition(String alias)
Find the position of a node with the given alias, relative to the underlying SQL select-list.<X extends SqmFrom<?,?>>
XfindFromByAlias(String identificationVariable, 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.void
register(SqmPath<?> sqmPath)
Register an SqmPathvoid
register(SqmAliasedNode<?> aliasedNode)
Register a node aliased within the select-clause<E> void
replace(SqmEntityJoin<E> sqmJoin, SqmRoot<E> sqmRoot)
Used with JPA compliance to treat secondary query roots as cross-joins.<X extends SqmFrom<?,?>>
XresolveFrom(SqmPath<?> path)
Similar toresolveFrom(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 path, Function<NavigablePath,SqmFrom<?,?>> creator)
Similar tofindFromByPath(org.hibernate.spi.NavigablePath)
, but accepting a producer to be used to create and register a SqmFrom if none yet registered.
-
-
-
Method Detail
-
register
void register(SqmPath<?> sqmPath)
Register an SqmPath
-
replace
<E> void replace(SqmEntityJoin<E> sqmJoin, SqmRoot<E> sqmRoot)
Used with JPA compliance to treat secondary query roots as cross-joins. Here we will replace thesqmRoot
with thesqmJoin
- API Note:
- Care should be taken when calling this method to ensure that nothing
has used the previous registration between its registration and this call.
Generally, most callers want
register(SqmPath)
instead.
-
findFromByAlias
<X extends SqmFrom<?,?>> X findFromByAlias(String identificationVariable, boolean searchParent)
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:
- matching SqmFrom or
null
-
findFromByPath
<X extends SqmFrom<?,?>> X findFromByPath(NavigablePath navigablePath)
Find a SqmFrom by its NavigablePath. Will search any parent contexts as well- Returns:
- matching SqmFrom or
null
-
findFromExposing
<X extends SqmFrom<?,?>> X findFromExposing(String navigableName)
Find a SqmFrom which exposes a Navigable by the given name. Will search any parent contexts as well- Returns:
- matching SqmFrom or
null
-
resolveFrom
<X extends SqmFrom<?,?>> X resolveFrom(NavigablePath path, Function<NavigablePath,SqmFrom<?,?>> creator)
Similar tofindFromByPath(org.hibernate.spi.NavigablePath)
, but accepting a producer to be used to create and register a SqmFrom if none yet registered.- Returns:
- The existing or just-created SqmFrom
-
resolveFrom
<X extends SqmFrom<?,?>> X resolveFrom(SqmPath<?> path)
Similar toresolveFrom(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.- Returns:
- The existing or just-created SqmFrom
-
register
void register(SqmAliasedNode<?> aliasedNode)
Register a node aliased within the select-clause
-
findAliasedNodeByAlias
SqmAliasedNode<?> findAliasedNodeByAlias(String alias)
Find a node (if one) by the explicit alias assigned to it within the select-clause- Returns:
- The matching node, or null
-
findAliasedNodePosition
Integer findAliasedNodePosition(String alias)
Find the position of a node with the given alias, relative to the underlying SQL select-list.- Returns:
- The position, or null
-
findAliasedNodeByPosition
SqmAliasedNode<?> findAliasedNodeByPosition(int position)
Find an SqmSelection by its position in the SqmSelectClause- Returns:
- The matching node, or null
-
-