JPA Interface

Join

Type Parameters:
<Z> - the source type of the join
<X> - the target type of the join

A join to an entity, embeddable, or basic type.
Since:
JPA 2.0
The FROM clause (JPQL / Criteria API) article explains how to use Join.

Public Methods

Attribute<?superZ,?> getAttribute()
Return the metamodel attribute corresponding to the join.
Return:
metamodel attribute corresponding to the join
Since:
JPA 2.0
Returns the parent From object from which the correlated From object has been obtained through correlation (use of a Subquery correlate method).
Return:
the parent of the correlated From object
Throws:
IllegalStateException - if the From object has not been obtained through correlation
Inherited from:
From<Z,X>
Since:
JPA 2.0
Return the join type.
Return:
join type
Since:
JPA 2.0
Set<Join<X,?>> getJoins()
Return the joins that have been made from this bound type.
Returns empty set if no joins have been made from this bound type. Modifications to the set do not affect the query.
Return:
joins made from this type
Inherited from:
From<Z,X>
Since:
JPA 2.0
Return the predicate that corresponds to the ON restriction(s) on the join, or null if no ON condition has been specified.
Return:
the ON restriction predicate
Since:
JPA 2.1
From<?,Z> getParent()
Return the parent of the join.
Return:
join parent
Since:
JPA 2.0
boolean isCorrelated()
Whether the From object has been obtained as a result of correlation (use of a Subquery correlate method).
Return:
boolean indicating whether the object has been obtained through correlation
Inherited from:
From<Z,X>
Since:
JPA 2.0
CollectionJoin<X,Y> join(CollectionAttribute<?superX,Y> collection)
Create an inner join to the specified Collection-valued attribute.
Parameters:
collection - target of the join
Return:
the resulting join
Inherited from:
From<Z,X>
Since:
JPA 2.0
CollectionJoin<X,Y> join(CollectionAttribute<?superX,Y> collection, JoinType jt)
Create a join to the specified Collection-valued attribute using the given join type.
Parameters:
collection - target of the join
jt - join type
Return:
the resulting join
Inherited from:
From<Z,X>
Since:
JPA 2.0
ListJoin<X,Y> join(ListAttribute<?superX,Y> list)
Create an inner join to the specified List-valued attribute.
Parameters:
list - target of the join
Return:
the resulting join
Inherited from:
From<Z,X>
Since:
JPA 2.0
ListJoin<X,Y> join(ListAttribute<?superX,Y> list, JoinType jt)
Create a join to the specified List-valued attribute using the given join type.
Parameters:
list - target of the join
jt - join type
Return:
the resulting join
Inherited from:
From<Z,X>
Since:
JPA 2.0
MapJoin<X,K,V> join(MapAttribute<?superX,K,V> map)
Create an inner join to the specified Map-valued attribute.
Parameters:
map - target of the join
Return:
the resulting join
Inherited from:
From<Z,X>
Since:
JPA 2.0
MapJoin<X,K,V> join(MapAttribute<?superX,K,V> map, JoinType jt)
Create a join to the specified Map-valued attribute using the given join type.
Parameters:
map - target of the join
jt - join type
Return:
the resulting join
Inherited from:
From<Z,X>
Since:
JPA 2.0
SetJoin<X,Y> join(SetAttribute<?superX,Y> set)
Create an inner join to the specified Set-valued attribute.
Parameters:
set - target of the join
Return:
the resulting join
Inherited from:
From<Z,X>
Since:
JPA 2.0
SetJoin<X,Y> join(SetAttribute<?superX,Y> set, JoinType jt)
Create a join to the specified Set-valued attribute using the given join type.
Parameters:
set - target of the join
jt - join type
Return:
the resulting join
Inherited from:
From<Z,X>
Since:
JPA 2.0
Join<X,Y> join(SingularAttribute<?superX,Y> attribute)
Create an inner join to the specified single-valued attribute.
Parameters:
attribute - target of the join
Return:
the resulting join
Inherited from:
From<Z,X>
Since:
JPA 2.0
Join<X,Y> join(SingularAttribute<?superX,Y> attribute, JoinType jt)
Create a join to the specified single-valued attribute using the given join type.
Parameters:
attribute - target of the join
jt - join type
Return:
the resulting join
Inherited from:
From<Z,X>
Since:
JPA 2.0
Join<X,Y> join(String attributeName)
Create an inner join to the specified attribute.
Parameters:
attributeName - name of the attribute for the target of the join
Return:
the resulting join
Throws:
IllegalArgumentException - if attribute of the given name does not exist
Inherited from:
From<Z,X>
Since:
JPA 2.0
Join<X,Y> join(String attributeName, JoinType jt)
Create a join to the specified attribute using the given join type.
Parameters:
attributeName - name of the attribute for the target of the join
jt - join type
Return:
the resulting join
Throws:
IllegalArgumentException - if attribute of the given name does not exist
Inherited from:
From<Z,X>
Since:
JPA 2.0
CollectionJoin<X,Y> joinCollection(String attributeName)
Create an inner join to the specified Collection-valued attribute.
Parameters:
attributeName - name of the attribute for the target of the join
Return:
the resulting join
Throws:
IllegalArgumentException - if attribute of the given name does not exist
Inherited from:
From<Z,X>
Since:
JPA 2.0
CollectionJoin<X,Y> joinCollection(String attributeName, JoinType jt)
Create a join to the specified Collection-valued attribute using the given join type.
Parameters:
attributeName - name of the attribute for the target of the join
jt - join type
Return:
the resulting join
Throws:
IllegalArgumentException - if attribute of the given name does not exist
Inherited from:
From<Z,X>
Since:
JPA 2.0
ListJoin<X,Y> joinList(String attributeName)
Create an inner join to the specified List-valued attribute.
Parameters:
attributeName - name of the attribute for the target of the join
Return:
the resulting join
Throws:
IllegalArgumentException - if attribute of the given name does not exist
Inherited from:
From<Z,X>
Since:
JPA 2.0
ListJoin<X,Y> joinList(String attributeName, JoinType jt)
Create a join to the specified List-valued attribute using the given join type.
Parameters:
attributeName - name of the attribute for the target of the join
jt - join type
Return:
the resulting join
Throws:
IllegalArgumentException - if attribute of the given name does not exist
Inherited from:
From<Z,X>
Since:
JPA 2.0
MapJoin<X,K,V> joinMap(String attributeName)
Create an inner join to the specified Map-valued attribute.
Parameters:
attributeName - name of the attribute for the target of the join
Return:
the resulting join
Throws:
IllegalArgumentException - if attribute of the given name does not exist
Inherited from:
From<Z,X>
Since:
JPA 2.0
MapJoin<X,K,V> joinMap(String attributeName, JoinType jt)
Create a join to the specified Map-valued attribute using the given join type.
Parameters:
attributeName - name of the attribute for the target of the join
jt - join type
Return:
the resulting join
Throws:
IllegalArgumentException - if attribute of the given name does not exist
Inherited from:
From<Z,X>
Since:
JPA 2.0
SetJoin<X,Y> joinSet(String attributeName)
Create an inner join to the specified Set-valued attribute.
Parameters:
attributeName - name of the attribute for the target of the join
Return:
the resulting join
Throws:
IllegalArgumentException - if attribute of the given name does not exist
Inherited from:
From<Z,X>
Since:
JPA 2.0
SetJoin<X,Y> joinSet(String attributeName, JoinType jt)
Create a join to the specified Set-valued attribute using the given join type.
Parameters:
attributeName - name of the attribute for the target of the join
jt - join type
Return:
the resulting join
Throws:
IllegalArgumentException - if attribute of the given name does not exist
Inherited from:
From<Z,X>
Since:
JPA 2.0
Join<Z,X> on(Expression<Boolean> restriction)
Modify the join to restrict the result according to the specified ON condition and return the join object.
Replaces the previous ON condition, if any.
Parameters:
restriction - a simple or compound boolean expression
Return:
the modified join object
Since:
JPA 2.1
Join<Z,X> on(Predicate... restrictions)
Modify the join to restrict the result according to the specified ON condition and return the join object.
Replaces the previous ON condition, if any.
Parameters:
restrictions - zero or more restriction predicates
Return:
the modified join object
Since:
JPA 2.1