Top Description Methods
org.hibernate.query.criteria

public Interface JpaPath<T>

extends JpaExpression<T>, Path<T>
Known Direct Subinterfaces
org.hibernate.query.sqm.tree.domain.SqmPath, org.hibernate.query.criteria.JpaFrom
Imports
java.util.Collection, .Map, jakarta.persistence.criteria.Path, jakarta.persistence.metamodel.MapAttribute, .PluralAttribute, .SingularAttribute, org.hibernate.metamodel.model.domain.EntityDomainType, org.hibernate.spi.NavigablePath

API extension to the JPA Path contract
Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public <Y> JpaPath<Y>
get(SingularAttribute<? super T, Y>
single-valued attribute
attribute
)

Redeclares jakarta.persistence.criteria.Path.get.

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

Redeclares jakarta.persistence.criteria.Path.get.

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

Redeclares jakarta.persistence.criteria.Path.get.

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

Redeclares jakarta.persistence.criteria.Path.get.

Create a path corresponding to the referenced attribute.
public JpaPath<?>
getLhs()

The source (think "left hand side") of this path

public NavigablePath
getNavigablePath()

Get this path's NavigablePath

public default JpaPath<?>
getParentPath()

Implements jakarta.persistence.criteria.Path.getParentPath.

Return the parent "node" in the path or null if no parent.
public <S extends T> JpaPath<S>
treatAs(Class<S> treatJavaType)

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

public <S extends T> JpaPath<S>
treatAs(EntityDomainType<S> treatJavaType)

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

public JpaExpression<Class<? extends T>>
type()

Redeclares jakarta.persistence.criteria.Path.type.

Create an expression corresponding to the type of the path.
Inherited from jakarta.persistence.criteria.Path:
getModel
Inherited from org.hibernate.query.criteria.JpaExpression:
asasBigDecimalasBigIntegerasDoubleasFloatasIntegerasLongasStringequalToequalToininininisNotNullisNull

Method Detail

getback to summary
public <Y> JpaPath<Y> get(SingularAttribute<? super T, Y> attribute)

Redeclares jakarta.persistence.criteria.Path.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:JpaPath<Y>

path corresponding to the referenced attribute

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

Redeclares jakarta.persistence.criteria.Path.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:JpaExpression<C>

expression corresponding to the referenced attribute

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

Redeclares jakarta.persistence.criteria.Path.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:JpaExpression<M>

expression corresponding to the referenced attribute

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

Redeclares jakarta.persistence.criteria.Path.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:JpaPath<Y>

path corresponding to the referenced attribute

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

The source (think "left hand side") of this path

getNavigablePathback to summary
public NavigablePath getNavigablePath()

Get this path's NavigablePath

getParentPathback to summary
public default JpaPath<?> getParentPath()

Implements jakarta.persistence.criteria.Path.getParentPath.

Doc from jakarta.persistence.criteria.Path.getParentPath.

Return the parent "node" in the path or null if no parent.

Returns:JpaPath<?>

parent

Annotations
@Override
treatAsback to summary
public <S extends T> JpaPath<S> treatAs(Class<S> treatJavaType)

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

treatAsback to summary
public <S extends T> JpaPath<S> treatAs(EntityDomainType<S> treatJavaType)

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

typeback to summary
public JpaExpression<Class<? extends T>> type()

Redeclares jakarta.persistence.criteria.Path.type.

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

Create an expression corresponding to the type of the path.

Returns:JpaExpression<Class<? extends T>>

expression corresponding to the type of the path

Annotations
@Override