Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.querydef

public Class PathImpl<X>

extends ExpressionImpl<X>
implements Path<X>, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, jakarta.persistence.criteria.Path, jakarta.persistence.criteria.Expression, jakarta.persistence.criteria.Selection, jakarta.persistence.TupleElement
Known Direct Subclasses
org.eclipse.persistence.internal.jpa.querydef.FromImpl
Imports
jakarta.persistence.criteria.Expression, .Path, jakarta.persistence.metamodel.Bindable, .MapAttribute, .Metamodel, .PluralAttribute, .SingularAttribute, org.eclipse.persistence.internal.localization.ExceptionLocalization

Purpose: Contains the implementation of the Path interface of the JPA criteria API.

Description: This class represents an abstract path which is a model of the expression through joins.

Author
gyorke
Since
EclipseLink 1.2
See Also
Path

Field Summary

Modifier and TypeField and Description
protected Object
protected Path<?>
Inherited from org.eclipse.persistence.internal.jpa.querydef.ExpressionImpl:
isLiteralliteralmetamodel

Constructor Summary

AccessConstructor and Description
public
PathImpl(Path<?> parent, Metamodel metamodel, Class<X> javaClass, Expression expressionNode, Bindable<T> modelArtifact)

Method Summary

Modifier and TypeMethod and Description
protected Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.
public void
public <Y> Path<Y>

Returns:

path corresponding to the referenced attribute
get
(SingularAttribute<? super X, Y>
attribute
att
)

Implements jakarta.persistence.criteria.Path.get.

Return the path corresponding to the referenced non-collection valued attribute.
public <E, C extends Collection<E>> Expression<C>

Returns:

expression corresponding to the referenced attribute
get
(PluralAttribute<X, C, E>
collection-valued attribute
collection
)

Implements jakarta.persistence.criteria.Path.get.

Return the path corresponding to the referenced collection-valued attribute.
public <K, V, M extends Map<K, V>> Expression<M>

Returns:

expression corresponding to the referenced attribute
get
(MapAttribute<X, K, V>
map-valued attribute
map
)

Implements jakarta.persistence.criteria.Path.get.

Return the path corresponding to the referenced map-valued attribute.
public <Y> Path<Y>
get(String
name of the attribute
attName
)

Implements jakarta.persistence.criteria.Path.get.

Create a path corresponding to the referenced attribute.
public Bindable<X>

Returns:

bindable object corresponding to the path
getModel
()

Implements jakarta.persistence.criteria.Path.getModel.

Return the bindable object that corresponds to the path expression.
public Path<?>

Returns:

parent
getParentPath
()

Implements jakarta.persistence.criteria.Path.getParentPath.

Return the parent "node" in the path.
public Expression<Class<? extends X>>

Returns:

expression corresponding to the type of the path
type
()

Implements jakarta.persistence.criteria.Path.type.

Return an expression corresponding to the type of the path.
Inherited from org.eclipse.persistence.internal.jpa.querydef.ExpressionImpl:
asbuildExpressionForAsininininisCompoundExpressionisExpressionisJunctionisLiteralisNotNullisNullisParameterisPredicateisSubquery

Field Detail

modelArtifactback to summary
protected Object modelArtifact
pathParentback to summary
protected Path<?> pathParent

Constructor Detail

PathImplback to summary
public PathImpl(Path<?> parent, Metamodel metamodel, Class<X> javaClass, Expression expressionNode, Bindable<T> modelArtifact)

Method Detail

cloneback to summary
protected Object clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:Object

a clone of this instance.

Annotations
@Override
findRootAndParametersback to summary
public void findRootAndParameters(CommonAbstractCriteriaImpl<T> query)

Overrides org.eclipse.persistence.internal.jpa.querydef.ExpressionImpl.findRootAndParameters.

Implements org.eclipse.persistence.internal.jpa.querydef.InternalSelection.findRootAndParameters.

Annotations
@Override
getback to summary
public <Y> Path<Y> get(SingularAttribute<? super X, Y> att)

Implements jakarta.persistence.criteria.Path.get.

Return the path corresponding to the referenced non-collection valued attribute.

Parameters
att:SingularAttribute<? super X, Y>

attribute

Returns:Path<Y>

path corresponding to the referenced attribute

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

Implements jakarta.persistence.criteria.Path.get.

Return the path corresponding to the referenced collection-valued attribute.

Parameters
collection:PluralAttribute<X, C, E>

collection-valued attribute

Returns:Expression<C>

expression corresponding to the referenced attribute

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

Implements jakarta.persistence.criteria.Path.get.

Return the path corresponding to the referenced map-valued attribute.

Parameters
map:MapAttribute<X, K, V>

map-valued attribute

Returns:Expression<M>

expression corresponding to the referenced attribute

Annotations
@Override
getback to summary
public <Y> Path<Y> get(String attName)

Implements 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
attName:String

name of the attribute

Returns:Path<Y>

path corresponding to the referenced attribute

Annotations
@Override
getModelback to summary
public Bindable<X> getModel()

Implements jakarta.persistence.criteria.Path.getModel.

Return the bindable object that corresponds to the path expression.

Returns:Bindable<X>

bindable object corresponding to the path

Annotations
@Override
getParentPathback to summary
public Path<?> getParentPath()

Implements jakarta.persistence.criteria.Path.getParentPath.

Return the parent "node" in the path.

Returns:Path<?>

parent

Annotations
@Override
typeback to summary
public Expression<Class<? extends X>> type()

Implements jakarta.persistence.criteria.Path.type.

Return an expression corresponding to the type of the path.

Returns:Expression<Class<? extends X>>

expression corresponding to the type of the path

Annotations
@Override