Top Description Methods
org.hibernate.query.sqm.tree.domain

public Interface SqmPath<T>

extends SqmExpression<T>, SemanticPathPart, JpaPath<T>
Known Direct Subinterfaces
org.hibernate.query.sqm.tree.domain.SqmPathWrapper, org.hibernate.query.sqm.tree.domain.SqmSimplePath, org.hibernate.query.sqm.tree.from.SqmFrom, org.hibernate.metamodel.model.domain.DiscriminatorSqmPath
Known Direct Implementers
org.hibernate.query.sqm.tree.domain.SqmIndexedCollectionAccessPath, org.hibernate.query.sqm.tree.domain.AbstractSqmPath, org.hibernate.query.sqm.tree.domain.AbstractSqmSpecificPluralPartPath
Imports
java.util.Collection, .List, .Map, java.util.function.Consumer, jakarta.persistence.metamodel.MapAttribute, .PluralAttribute, .SingularAttribute, org.hibernate.metamodel.model.domain.EntityDomainType, org.hibernate.query.SemanticException, org.hibernate.spi.NavigablePath, org.hibernate.query.criteria.JpaPath, org.hibernate.query.hql.spi.SemanticPathPart, .SqmCreationState, org.hibernate.query.sqm.ParsingException, .SqmExpressible, .SqmPathSource, org.hibernate.query.sqm.tree.SqmCopyContext, org.hibernate.query.sqm.tree.expression.SqmExpression, org.hibernate.query.sqm.tree.from.SqmRoot, org.hibernate.type.descriptor.java.JavaType

Models a reference to a part of the application's domain model as part of an SQM tree. This correlates roughly to the JPA Criteria notion of Path, hence the name.
Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public default void
applyInferableType(SqmExpressible<?> type)

Implements org.hibernate.query.sqm.tree.expression.SqmExpression.applyInferableType.

Used to apply type information based on the expression's usage within the query.
public SqmPath<T>
public default SqmRoot<?>
public <Y> SqmPath<Y>
get(SingularAttribute<? super T, Y>
single-valued attribute
attribute
)

Redeclares org.hibernate.query.criteria.JpaPath.get.

Create a path corresponding to the referenced single-valued attribute.
public <E, C extends Collection<E>> SqmExpression<C>
get(PluralAttribute<T, C, E>
collection-valued attribute
collection
)

Redeclares org.hibernate.query.criteria.JpaPath.get.

Create a path corresponding to the referenced collection-valued attribute.
public <K, V, M extends Map<K, V>> SqmExpression<M>
get(MapAttribute<T, K, V>
map-valued attribute
map
)

Redeclares org.hibernate.query.criteria.JpaPath.get.

Create a path corresponding to the referenced map-valued attribute.
public <Y> SqmPath<Y>
get(String
name of the attribute
attributeName
)

Redeclares org.hibernate.query.criteria.JpaPath.get.

Create a path corresponding to the referenced attribute.
public String
getExplicitAlias()

Retrieve the explicit alias, if one.

public default JavaType<T>
public SqmPath<?>
getLhs()

Redeclares org.hibernate.query.criteria.JpaPath.getLhs.

Get the left-hand side of this path - may be null, indicating a root, cross-join or entity-join
public NavigablePath
public SqmPathSource<T>
getNodeType()

Redeclares org.hibernate.query.sqm.tree.expression.SqmExpression.getNodeType.

This node's type is its "referenced path source"
public SqmPathSource<?>
getReferencedPathSource()

The path source that this path refers to (and that most likely created it).

public SqmPathSource<?>
getResolvedModel()

Get this path's actual resolved model, i.e. the concrete type for generic attributes.

public SqmPath<?>
public List<SqmPath<?>>
getReusablePaths()

Returns an immutable List of reusable paths

public void
registerReusablePath(SqmPath<?> path)

Register a reusable path relative to this path

public default String
resolveAlias()

Retrieve the explicit alias, if one, otherwise return a generated one and set that as explicit alias.

public default SqmPath<?>
public SqmPath<?>
public void
setExplicitAlias(String explicitAlias)

Set the explicit alias for this path

public <S extends T> SqmPath<S>
treatAs(Class<S> treatJavaType)

Redeclares org.hibernate.query.criteria.JpaPath.treatAs.

Support for JPA's explicit (TREAT) down-casting.
public <S extends T> SqmPath<S>
treatAs(EntityDomainType<S> treatTarget)

Redeclares org.hibernate.query.criteria.JpaPath.treatAs.

Support for JPA's explicit (TREAT) down-casting.
public SqmExpression<Class<? extends T>>
type()

Redeclares org.hibernate.query.criteria.JpaPath.type.

Create an expression corresponding to the type of the path.
public void
visitReusablePaths(Consumer<SqmPath<?>> consumer)

Visit each reusable path relative to this path

Inherited from org.hibernate.query.criteria.JpaPath:
getParentPath
Inherited from org.hibernate.query.sqm.tree.expression.SqmExpression:
asasBigDecimalasBigIntegerasDoubleasFloatasIntegerasLongasStringcastAsequalToequalToininininisNotNullisNullvisitSubSelectableNodes

Method Detail

applyInferableTypeback to summary
public default void applyInferableType(SqmExpressible<?> type)

Implements org.hibernate.query.sqm.tree.expression.SqmExpression.applyInferableType.

Doc from org.hibernate.query.sqm.tree.expression.SqmExpression.applyInferableType.

Used to apply type information based on the expression's usage within the query.

Annotations
@Override
copyback to summary
public SqmPath<T> copy(SqmCopyContext context)

Redeclares org.hibernate.query.sqm.tree.expression.SqmExpression.copy.

Annotations
@Override
findRootback to summary
public default SqmRoot<?> findRoot()
getback to summary
public <Y> SqmPath<Y> get(SingularAttribute<? super T, Y> attribute)

Redeclares org.hibernate.query.criteria.JpaPath.get.

Doc from jakarta.persistence.criteria.Path.get.

Create a path corresponding to the referenced single-valued attribute.

Parameters
attribute:SingularAttribute<? super T, Y>

single-valued attribute

Returns:SqmPath<Y>

path corresponding to the referenced attribute

Annotations
@Override
getback to summary
public <E, C extends Collection<E>> SqmExpression<C> get(PluralAttribute<T, C, E> collection)

Redeclares org.hibernate.query.criteria.JpaPath.get.

Doc from jakarta.persistence.criteria.Path.get.

Create a path corresponding to the referenced collection-valued attribute.

Parameters
collection:PluralAttribute<T, C, E>

collection-valued attribute

Returns:SqmExpression<C>

expression corresponding to the referenced attribute

Annotations
@Override
getback to summary
public <K, V, M extends Map<K, V>> SqmExpression<M> get(MapAttribute<T, K, V> map)

Redeclares org.hibernate.query.criteria.JpaPath.get.

Doc from jakarta.persistence.criteria.Path.get.

Create a path corresponding to the referenced map-valued attribute.

Parameters
map:MapAttribute<T, K, V>

map-valued attribute

Returns:SqmExpression<M>

expression corresponding to the referenced attribute

Annotations
@Override
getback to summary
public <Y> SqmPath<Y> get(String attributeName)

Redeclares org.hibernate.query.criteria.JpaPath.get.

Doc from jakarta.persistence.criteria.Path.get.

Create a path corresponding to the referenced attribute.

Note

Applications using the string-based API may need to specify the type resulting from the get operation in order to avoid the use of Path variables.

   For example:

   CriteriaQuery<Person> q = cb.createQuery(Person.class);
   Root<Person> p = q.from(Person.class);
   q.select(p)
    .where(cb.isMember("joe",
                       p.<Set<String>>get("nicknames")));

   rather than:

   CriteriaQuery<Person> q = cb.createQuery(Person.class);
   Root<Person> p = q.from(Person.class);
   Path<Set<String>> nicknames = p.get("nicknames");
   q.select(p)
    .where(cb.isMember("joe", nicknames));
Parameters
attributeName:String

name of the attribute

Returns:SqmPath<Y>

path corresponding to the referenced attribute

Annotations
@Override
getExplicitAliasback to summary
public String getExplicitAlias()

Retrieve the explicit alias, if one. May return null

getJavaTypeDescriptorback to summary
public default JavaType<T> getJavaTypeDescriptor()

Implements org.hibernate.query.criteria.JpaTupleElement.getJavaTypeDescriptor.

Annotations
@Override
getLhsback to summary
public SqmPath<?> getLhs()

Redeclares org.hibernate.query.criteria.JpaPath.getLhs.

Get the left-hand side of this path - may be null, indicating a root, cross-join or entity-join

getNavigablePathback to summary
public NavigablePath getNavigablePath()

Redeclares org.hibernate.query.criteria.JpaPath.getNavigablePath.

Returns the NavigablePath.

getNodeTypeback to summary
public SqmPathSource<T> getNodeType()

Redeclares org.hibernate.query.sqm.tree.expression.SqmExpression.getNodeType.

This node's type is its "referenced path source"

Annotations
@Override
getReferencedPathSourceback to summary
public SqmPathSource<?> getReferencedPathSource()

The path source that this path refers to (and that most likely created it).

See Also
SqmPathSource#createSqmPath
getResolvedModelback to summary
public SqmPathSource<?> getResolvedModel()

Get this path's actual resolved model, i.e. the concrete type for generic attributes.

getReusablePathback to summary
public SqmPath<?> getReusablePath(String name)
getReusablePathsback to summary
public List<SqmPath<?>> getReusablePaths()

Returns an immutable List of reusable paths

registerReusablePathback to summary
public void registerReusablePath(SqmPath<?> path)

Register a reusable path relative to this path

resolveAliasback to summary
public default String resolveAlias()

Retrieve the explicit alias, if one, otherwise return a generated one and set that as explicit alias.

resolveIndexedAccessback to summary
public default SqmPath<?> resolveIndexedAccess(SqmExpression<?> selector, boolean isTerminal, SqmCreationState creationState)

Implements org.hibernate.query.hql.spi.SemanticPathPart.resolveIndexedAccess.

Annotations
@Override
resolvePathPartback to summary
public SqmPath<?> resolvePathPart(String name, boolean isTerminal, SqmCreationState creationState)

Redeclares org.hibernate.query.hql.spi.SemanticPathPart.resolvePathPart.

setExplicitAliasback to summary
public void setExplicitAlias(String explicitAlias)

Set the explicit alias for this path

treatAsback to summary
public <S extends T> SqmPath<S> treatAs(Class<S> treatJavaType)

Redeclares org.hibernate.query.criteria.JpaPath.treatAs.

Doc from org.hibernate.query.criteria.JpaPath.treatAs.

Support for JPA's explicit (TREAT) down-casting.

Annotations
@Override
treatAsback to summary
public <S extends T> SqmPath<S> treatAs(EntityDomainType<S> treatTarget)

Redeclares org.hibernate.query.criteria.JpaPath.treatAs.

Doc from org.hibernate.query.criteria.JpaPath.treatAs.

Support for JPA's explicit (TREAT) down-casting.

Annotations
@Override
typeback to summary
public SqmExpression<Class<? extends T>> type()

Redeclares org.hibernate.query.criteria.JpaPath.type.

Doc from jakarta.persistence.criteria.Path.type.

Create an expression corresponding to the type of the path.

Returns:SqmExpression<Class<? extends T>>

expression corresponding to the type of the path

Annotations
@Override
visitReusablePathsback to summary
public void visitReusablePaths(Consumer<SqmPath<?>> consumer)

Visit each reusable path relative to this path