Jakarta Persistence (JPA) Interface
jakarta.persistence.criteria.Join<Z,X>
- Type Parameters:
<Z>- the source type of the join<X>- the target type of the join
- Super Interfaces:
From<Z,X>,Path<X>,FetchParent<Z,X>,Expression<X>,Selection<T>,TupleElement<X>
A join to an entity, embeddable, or basic type.
- Since:
- Jakarta Persistence (JPA) 2.0
The FROM clause (JPQL / Criteria API) article explains how to use
Join.Public Instance Methods
Once assigned, an alias cannot be changed or reassigned. Returns the same selection item.
Inherited from
Selection<X>- Parameters:
name- alias
- Returns:
- selection item.
- Since:
- Jakarta Persistence (JPA) 1.0
Unlike
Expression.cast, this method does not cause type conversion: the runtime type is not changed. Warning: may result in a runtime failure.
Inherited from
Expression<T>- Parameters:
type- intended type of the expression
- Returns:
- new expression of the given type.
- See Also:
- Since:
- Jakarta Persistence (JPA) 1.0
Unlike
Expression.as, this method does result in a runtime type conversion. Providers are required to support casting scalar expressions to String, and String expressions to Integer, Long, Float, and Double. Support for typecasts between other basic types is not required.
Inherited from
Expression<T>- Parameters:
type- a basic type
- Returns:
- a scalar expression of the given basic type.
- Since:
- Jakarta Persistence (JPA) 3.2
Inherited from
Expression<T>- Parameters:
value- expression to be tested against
- Returns:
- predicate testing for equality.
- Since:
- Jakarta Persistence (JPA) 3.2
Inherited from
Expression<T>- Parameters:
value- value to be tested against
- Returns:
- predicate testing for equality.
- Since:
- Jakarta Persistence (JPA) 3.2
Inherited from
FetchParent<Z,X>- Parameters:
attribute- target of the join
- Returns:
- the resulting fetch join.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
FetchParent<Z,X>- Parameters:
jt- join typeattribute- target of the join
- Returns:
- the resulting fetch join.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
FetchParent<Z,X>- Parameters:
attribute- target of the join
- Returns:
- the resulting join.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
FetchParent<Z,X>- Parameters:
jt- join typeattribute- target of the join
- Returns:
- the resulting join.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
FetchParent<Z,X>- Parameters:
attributeName- name of the attribute for the target of the join
- Returns:
- the resulting fetch join.
- Throws:
- if attribute of the given name does not exist.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
FetchParent<Z,X>- Parameters:
attributeName- name of the attribute for the target of the joinjt- join type
- Returns:
- the resulting fetch join.
- Throws:
- if attribute of the given name does not exist.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
Path<X>- Parameters:
attribute- single-valued attribute
- Returns:
- path corresponding to the referenced attribute.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
Path<X>- Parameters:
collection- collection-valued attribute
- Returns:
- expression corresponding to the referenced attribute.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
Path<X>- Parameters:
map- map-valued attribute
- Returns:
- expression corresponding to the referenced attribute.
- Since:
- Jakarta Persistence (JPA) 1.0
Note: Applications using the string-based API may need to specify the type resulting from the Path.get operation in order to avoid the use of Path variables.
For example:
CriteriaQuery q = cb.createQuery(Person.class); Root p = q.from(Person.class); q.select(p) .where(cb.isMember("joe", p.>get("nicknames")));
rather than:
CriteriaQuery q = cb.createQuery(Person.class); Root p = q.from(Person.class); Path> nicknames = p.get("nicknames"); q.select(p) .where(cb.isMember("joe", nicknames));
Inherited from
Path<X>- Parameters:
attributeName- name of the attribute
- Returns:
- path corresponding to the referenced attribute.
- Throws:
- if invoked on a path that corresponds to a basic type.IllegalStateException- if attribute of the given name does not otherwise exist.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
String getAlias()- Returns:
- metamodel attribute or null.
- Since:
- Jakarta Persistence (JPA) 1.0
Modifications to the list do not affect the query.
Inherited from
Selection<X>- Returns:
- list of selection items.
- Throws:
- if selection is not a compound selection.IllegalStateException
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Returns:
- the parent of the correlated
Fromobject.
- Throws:
- if theIllegalStateExceptionFromobject has not been obtained through correlation.
- Since:
- Jakarta Persistence (JPA) 1.0
Returns empty set if no fetch joins have been made from this type. Modifications to the set do not affect the query.
Inherited from
FetchParent<Z,X>- Returns:
- fetch joins made from this type.
- Since:
- Jakarta Persistence (JPA) 1.0
Class<? extends X> getJavaType()Inherited from
TupleElement<X>- Returns:
- the Java type of the tuple element.
- Since:
- Jakarta Persistence (JPA) 1.0
- Returns:
- join type.
- Since:
- Jakarta Persistence (JPA) 1.0
Returns empty set if no joins have been made from this bound type. Modifications to the set do not affect the query.
Inherited from
From<Z,X>- Returns:
- joins made from this type.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
Path<X>- Returns:
- bindable object corresponding to the path.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
Expression<T>- Parameters:
values- values to be tested against
- Returns:
- predicate testing for membership.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
Expression<T>- Parameters:
values- expressions to be tested against
- Returns:
- predicate testing for membership.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
Expression<T>- Parameters:
values- collection of values to be tested against
- Returns:
- predicate testing for membership.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
Expression<T>- Parameters:
values- expression corresponding to collection to be tested against
- Returns:
- predicate testing for membership.
- Since:
- Jakarta Persistence (JPA) 1.0
boolean isCompoundSelection()Inherited from
Selection<X>- Returns:
- boolean indicating whether the selection is a compound selection.
- Since:
- Jakarta Persistence (JPA) 1.0
boolean isCorrelated()Inherited from
From<Z,X>- Returns:
- boolean indicating whether the object has been obtained through correlation.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
Expression<T>- Returns:
- predicate testing whether the expression is not null.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
Expression<T>- Returns:
- predicate testing whether the expression is null.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
entityClass- the target entity class
- Returns:
- the resulting join.
- Since:
- Jakarta Persistence (JPA) 3.2
Inherited from
From<Z,X>- Parameters:
entityClass- the target entity classjoinType- join type
- Returns:
- the resulting join.
- Since:
- Jakarta Persistence (JPA) 3.2
Inherited from
From<Z,X>- Parameters:
entity- metamodel entity representing the join target
- Returns:
- the resulting join.
- Since:
- Jakarta Persistence (JPA) 3.2
Inherited from
From<Z,X>- Parameters:
entity- metamodel entity representing the join targetjoinType- join type
- Returns:
- the resulting join.
- Since:
- Jakarta Persistence (JPA) 3.2
Inherited from
From<Z,X>- Parameters:
attribute- target of the join
- Returns:
- the resulting join.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
jt- join typeattribute- target of the join
- Returns:
- the resulting join.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
collection- target of the join
- Returns:
- the resulting join.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
set- target of the join
- Returns:
- the resulting join.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
list- target of the join
- Returns:
- the resulting join.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
map- target of the join
- Returns:
- the resulting join.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
jt- join typecollection- target of the join
- Returns:
- the resulting join.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
jt- join typeset- target of the join
- Returns:
- the resulting join.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
jt- join typelist- target of the join
- Returns:
- the resulting join.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
jt- join typemap- target of the join
- Returns:
- the resulting join.
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
attributeName- name of the attribute for the target of the join
- Returns:
- the resulting join.
- Throws:
- if attribute of the given name does not exist.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
attributeName- name of the attribute for the target of the joinjt- join type
- Returns:
- the resulting join.
- Throws:
- if attribute of the given name does not exist.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
attributeName- name of the attribute for the target of the join
- Returns:
- the resulting join.
- Throws:
- if attribute of the given name does not exist.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
attributeName- name of the attribute for the target of the joinjt- join type
- Returns:
- the resulting join.
- Throws:
- if attribute of the given name does not exist.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
attributeName- name of the attribute for the target of the join
- Returns:
- the resulting join.
- Throws:
- if attribute of the given name does not exist.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
attributeName- name of the attribute for the target of the joinjt- join type
- Returns:
- the resulting join.
- Throws:
- if attribute of the given name does not exist.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
attributeName- name of the attribute for the target of the join
- Returns:
- the resulting join.
- Throws:
- if attribute of the given name does not exist.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
attributeName- name of the attribute for the target of the joinjt- join type
- Returns:
- the resulting join.
- Throws:
- if attribute of the given name does not exist.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
attributeName- name of the attribute for the target of the join
- Returns:
- the resulting join.
- Throws:
- if attribute of the given name does not exist.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
From<Z,X>- Parameters:
attributeName- name of the attribute for the target of the joinjt- join type
- Returns:
- the resulting join.
- Throws:
- if attribute of the given name does not exist.IllegalArgumentException
- Since:
- Jakarta Persistence (JPA) 1.0
Inherited from
Expression<T>- Parameters:
value- expression to be tested against
- Returns:
- predicate testing for inequality.
- Since:
- Jakarta Persistence (JPA) 3.2
Inherited from
Expression<T>- Parameters:
value- value to be tested against
- Returns:
- predicate testing for inequality.
- Since:
- Jakarta Persistence (JPA) 3.2
Replaces the previous ON condition, if any.
- Parameters:
restriction- a simple or compound boolean expression
- Returns:
- the modified join object.
- Since:
- Jakarta Persistence (JPA) 2.1
Replaces the previous ON condition, if any.
- Parameters:
restrictions- zero or more restriction predicates
- Returns:
- the modified join object.
- Since:
- Jakarta Persistence (JPA) 2.1
Inherited from
Path<X>- Returns:
- expression corresponding to the type of the path.
- Since:
- Jakarta Persistence (JPA) 1.0