Top Fields Constructors Methods
org.hibernate.query.sqm.tree.domain

public abstract Class AbstractSqmPath<T>

extends AbstractSqmExpression<T>
implements SqmPath<T>
Class Inheritance
All Implemented Interfaces
org.hibernate.query.sqm.tree.domain.SqmPath, org.hibernate.query.criteria.JpaPath, jakarta.persistence.criteria.Path, jakarta.persistence.criteria.Expression, jakarta.persistence.criteria.Selection, jakarta.persistence.TupleElement, org.hibernate.query.criteria.JpaExpression, org.hibernate.query.criteria.JpaSelection, org.hibernate.query.criteria.JpaTupleElement, org.hibernate.query.criteria.JpaCriteriaNode, java.io.Serializable, org.hibernate.query.hql.spi.SemanticPathPart, org.hibernate.query.sqm.tree.expression.SqmExpression, org.hibernate.query.sqm.tree.select.SqmSelectableNode, org.hibernate.query.sqm.tree.SqmTypedNode, org.hibernate.query.sqm.tree.SqmVisitableNode, org.hibernate.query.sqm.tree.SqmNode, org.hibernate.query.sqm.tree.SqmExpressibleAccessor
Known Direct Subclasses
org.hibernate.query.sqm.tree.domain.AbstractSqmSimplePath, org.hibernate.query.sqm.tree.domain.AbstractSqmSpecificPluralPartPath, org.hibernate.metamodel.model.domain.internal.AnyDiscriminatorSqmPath, org.hibernate.metamodel.model.domain.internal.EntityDiscriminatorSqmPath, org.hibernate.query.sqm.tree.domain.SqmIndexedCollectionAccessPath, org.hibernate.query.sqm.tree.domain.AbstractSqmFrom
Imports
java.util.ArrayList, .Collections, .HashMap, .List, .Map, java.util.function.Consumer, org.hibernate.metamodel.mapping.CollectionPart, .EntityDiscriminatorMapping, org.hibernate.metamodel.model.domain.DomainType, .EntityDomainType, .ManagedDomainType, .PersistentAttribute, org.hibernate.query.sqm.NodeBuilder, .SqmExpressible, .SqmPathSource, org.hibernate.query.sqm.tree.SqmCopyContext, org.hibernate.query.sqm.tree.expression.AbstractSqmExpression, .SqmExpression, .SqmLiteral, org.hibernate.spi.EntityIdentifierNavigablePath, .NavigablePath, .TreatedNavigablePath, jakarta.persistence.metamodel.MapAttribute, .PluralAttribute, .SingularAttribute

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final SqmPath<?>
private Map<String, SqmPath<?>>
reusablePaths

For HQL and Criteria processing - used to track reusable paths relative to this path.

Constructor Summary

AccessConstructor and Description
protected
AbstractSqmPath(NavigablePath navigablePath, SqmPathSource<T> referencedPathSource, SqmPath<?> lhs, NodeBuilder nodeBuilder)

Method Summary

Modifier and TypeMethod and Description
protected void
public SqmPath<?>
get(String
name of the attribute
attributeName
)

Implements org.hibernate.query.sqm.tree.domain.SqmPath.get.

Create a path corresponding to the referenced attribute.
public <Y> SqmPath<Y>
get(SingularAttribute<? super T, Y>
single-valued attribute
jpaAttribute
)

Implements org.hibernate.query.sqm.tree.domain.SqmPath.get.

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

Implements org.hibernate.query.sqm.tree.domain.SqmPath.get.

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

Implements org.hibernate.query.sqm.tree.domain.SqmPath.get.

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

Implements org.hibernate.query.sqm.tree.domain.SqmPath.getExplicitAlias.

Retrieve the explicit alias, if one.
public SqmExpressible<T>
public SqmPath<?>
getLhs()

Implements org.hibernate.query.sqm.tree.domain.SqmPath.getLhs.

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

Implements jakarta.persistence.criteria.Path.getModel.

Return the bindable object that corresponds to the path expression.
public NavigablePath
protected NavigablePath
getNavigablePathCopy(SqmPath<?> parent)

Utility that checks if this path's parent navigable path is compatible with the specified SQM parent, and if not creates a copy of the navigable path with the correct parent.

public SqmPathSource<T>
private NavigablePath
public SqmPathSource<T>
getReferencedPathSource()

Implements org.hibernate.query.sqm.tree.domain.SqmPath.getReferencedPathSource.

The path source that this path refers to (and that most likely created it).
public SqmPathSource<?>
getResolvedModel()

Implements org.hibernate.query.sqm.tree.domain.SqmPath.getResolvedModel.

Get this path's actual resolved model, i.e. the concrete type for generic attributes.
public SqmPath<?>
public List<SqmPath<?>>
getReusablePaths()

Implements org.hibernate.query.sqm.tree.domain.SqmPath.getReusablePaths.

Returns an immutable List of reusable paths
private SqmPath<?>
getRoot(SqmPath<?> lhs)

protected <S extends T> SqmTreatedPath<T, S>
public void
registerReusablePath(SqmPath<?> path)

Implements org.hibernate.query.sqm.tree.domain.SqmPath.registerReusablePath.

Register a reusable path relative to this path
protected <X> SqmPath<X>
protected <X> SqmPath<X>
resolvePath(String attributeName, SqmPathSource<X> pathSource)

public void
setExplicitAlias(String explicitAlias)

Implements org.hibernate.query.sqm.tree.domain.SqmPath.setExplicitAlias.

Set the explicit alias for this path
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public SqmExpression<Class<? extends T>>
type()

Implements org.hibernate.query.sqm.tree.domain.SqmPath.type.

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

Implements org.hibernate.query.sqm.tree.domain.SqmPath.visitReusablePaths.

Visit each reusable path relative to this path
Inherited from org.hibernate.query.sqm.tree.expression.AbstractSqmExpression:
aliasapplyInferableTypeasasBigDecimalasBigIntegerasDoubleasFloatasIntegerasLongasStringequalToequalTogetJavaTypeDescriptorinininininternalApplyInferableTypeisNotNullisNullnodeBuilder

Field Detail

lhsback to summary
private final SqmPath<?> lhs
reusablePathsback to summary
private Map<String, SqmPath<?>> reusablePaths

For HQL and Criteria processing - used to track reusable paths relative to this path. E.g., given `p.mate.mate` the SqmRoot identified by `p` would have a reusable path for the `p.mate` path.

Constructor Detail

AbstractSqmPathback to summary
protected AbstractSqmPath(NavigablePath navigablePath, SqmPathSource<T> referencedPathSource, SqmPath<?> lhs, NodeBuilder nodeBuilder)

Method Detail

copyToback to summary
protected void copyTo(AbstractSqmPath<T> target, SqmCopyContext context)
getback to summary
public SqmPath<?> get(String attributeName)

Implements org.hibernate.query.sqm.tree.domain.SqmPath.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<?>

path corresponding to the referenced attribute

Annotations
@Override
@SuppressWarnings:unchecked
getback to summary
public <Y> SqmPath<Y> get(SingularAttribute<? super T, Y> jpaAttribute)

Implements org.hibernate.query.sqm.tree.domain.SqmPath.get.

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

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

Parameters
jpaAttribute:SingularAttribute<? super T, Y>

single-valued attribute

Returns:SqmPath<Y>

path corresponding to the referenced attribute

Annotations
@Override
@SuppressWarnings:unchecked
getback to summary
public <E, C extends Collection<E>> SqmPath<C> get(PluralAttribute<T, C, E> attribute)

Implements org.hibernate.query.sqm.tree.domain.SqmPath.get.

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

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

Parameters
attribute:PluralAttribute<T, C, E>

collection-valued attribute

Returns:SqmPath<C>

expression corresponding to the referenced attribute

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

Implements org.hibernate.query.sqm.tree.domain.SqmPath.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:SqmPath<M>

expression corresponding to the referenced attribute

Annotations
@Override
@SuppressWarnings:unchecked
getExplicitAliasback to summary
public String getExplicitAlias()

Implements org.hibernate.query.sqm.tree.domain.SqmPath.getExplicitAlias.

Doc from org.hibernate.query.sqm.tree.domain.SqmPath.getExplicitAlias.

Retrieve the explicit alias, if one. May return null

Annotations
@Override
getExpressibleback to summary
public SqmExpressible<T> getExpressible()

Overrides default org.hibernate.query.sqm.tree.SqmTypedNode.getExpressible.

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

Implements org.hibernate.query.sqm.tree.domain.SqmPath.getLhs.

Doc from org.hibernate.query.sqm.tree.domain.SqmPath.getLhs.

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

Annotations
@Override
getModelback to summary
public SqmPathSource<T> getModel()

Implements jakarta.persistence.criteria.Path.getModel.

Doc from jakarta.persistence.criteria.Path.getModel.

Return the bindable object that corresponds to the path expression.

Returns:SqmPathSource<T>

bindable object corresponding to the path

Annotations
@Override
getNavigablePathback to summary
public NavigablePath getNavigablePath()

Implements org.hibernate.query.sqm.tree.domain.SqmPath.getNavigablePath.

Doc from org.hibernate.query.sqm.tree.domain.SqmPath.getNavigablePath.

Returns the NavigablePath.

Annotations
@Override
getNavigablePathCopyback to summary
protected NavigablePath getNavigablePathCopy(SqmPath<?> parent)

Utility that checks if this path's parent navigable path is compatible with the specified SQM parent, and if not creates a copy of the navigable path with the correct parent.

getNodeTypeback to summary
public SqmPathSource<T> getNodeType()

Overrides org.hibernate.query.sqm.tree.jpa.AbstractJpaTupleElement.getNodeType.

Implements org.hibernate.query.sqm.tree.domain.SqmPath.getNodeType, org.hibernate.query.sqm.tree.expression.SqmExpression.getNodeType, org.hibernate.query.sqm.tree.SqmTypedNode.getNodeType.

Doc from org.hibernate.query.sqm.tree.domain.SqmPath.getNodeType.

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

Annotations
@Override
getRealParentPathback to summary
private NavigablePath getRealParentPath(NavigablePath realParent, NavigablePath parent)
getReferencedPathSourceback to summary
public SqmPathSource<T> getReferencedPathSource()

Implements org.hibernate.query.sqm.tree.domain.SqmPath.getReferencedPathSource.

Doc from org.hibernate.query.sqm.tree.domain.SqmPath.getReferencedPathSource.

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

Annotations
@Override
getResolvedModelback to summary
public SqmPathSource<?> getResolvedModel()

Implements org.hibernate.query.sqm.tree.domain.SqmPath.getResolvedModel.

Doc from org.hibernate.query.sqm.tree.domain.SqmPath.getResolvedModel.

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

Annotations
@Override
getReusablePathback to summary
public SqmPath<?> getReusablePath(String name)

Implements org.hibernate.query.sqm.tree.domain.SqmPath.getReusablePath.

Annotations
@Override
getReusablePathsback to summary
public List<SqmPath<?>> getReusablePaths()

Implements org.hibernate.query.sqm.tree.domain.SqmPath.getReusablePaths.

Doc from org.hibernate.query.sqm.tree.domain.SqmPath.getReusablePaths.

Returns an immutable List of reusable paths

Annotations
@Override
getRootback to summary
private SqmPath<?> getRoot(SqmPath<?> lhs)
getTreatedPathback to summary
protected <S extends T> SqmTreatedPath<T, S> getTreatedPath(EntityDomainType<S> treatTarget)
registerReusablePathback to summary
public void registerReusablePath(SqmPath<?> path)

Implements org.hibernate.query.sqm.tree.domain.SqmPath.registerReusablePath.

Doc from org.hibernate.query.sqm.tree.domain.SqmPath.registerReusablePath.

Register a reusable path relative to this path

Annotations
@Override
resolvePathback to summary
protected <X> SqmPath<X> resolvePath(PersistentAttribute<?, X> attribute)
resolvePathback to summary
protected <X> SqmPath<X> resolvePath(String attributeName, SqmPathSource<X> pathSource)
setExplicitAliasback to summary
public void setExplicitAlias(String explicitAlias)

Implements org.hibernate.query.sqm.tree.domain.SqmPath.setExplicitAlias.

Doc from org.hibernate.query.sqm.tree.domain.SqmPath.setExplicitAlias.

Set the explicit alias for this path

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

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

Implements org.hibernate.query.sqm.tree.domain.SqmPath.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
@SuppressWarnings:unchecked
visitReusablePathsback to summary
public void visitReusablePaths(Consumer<SqmPath<?>> consumer)

Implements org.hibernate.query.sqm.tree.domain.SqmPath.visitReusablePaths.

Doc from org.hibernate.query.sqm.tree.domain.SqmPath.visitReusablePaths.

Visit each reusable path relative to this path

Annotations
@Override