Top Description Methods
javax.persistence.criteria

public Interface From<Z, X>

extends Path<X>, FetchParent<Z, X>
Known Direct Subinterfaces
javax.persistence.criteria.Join, javax.persistence.criteria.Root
Annotations
@SuppressWarnings:hiding
Type Parameters
<Z>
the source type
<X>
the target type
Imports
javax.persistence.metamodel.SingularAttribute, .CollectionAttribute, .ListAttribute, .MapAttribute, .SetAttribute, java.util.Set

Represents a bound type, usually an entity that appears in the from clause, but may also be an embeddable belonging to an entity in the from clause.

Serves as a factory for Joins of associations, embeddables, and collections belonging to the type, and for Paths of attributes belonging to the type.

Since
Java Persistence 2.0

Method Summary

Modifier and TypeMethod and Description
public From<Z, X>

Returns:

the parent of the correlated From object
getCorrelationParent
()

Returns the parent From object from which the correlated From object has been obtained through correlation (use of a Subquery correlate method).

public Set<Join<X, ?>>

Returns:

joins made from this type
getJoins
()

Return the joins that have been made from this bound type.

public boolean

Returns:

boolean indicating whether the object has been obtained through correlation
isCorrelated
()

Whether the From object has been obtained as a result of correlation (use of a Subquery correlate method).

public <Y> Join<X, Y>

Returns:

the resulting join
join
(SingularAttribute<? super X, Y>
target of the join
attribute
)

Create an inner join to the specified single-valued attribute.

public <Y> Join<X, Y>

Returns:

the resulting join
join
(SingularAttribute<? super X, Y>
target of the join
attribute
,
JoinType
join type
jt
)

Create a join to the specified single-valued attribute using the given join type.

public <Y> CollectionJoin<X, Y>

Returns:

the resulting join
join
(CollectionAttribute<? super X, Y>
target of the join
collection
)

Create an inner join to the specified Collection-valued attribute.

public <Y> SetJoin<X, Y>

Returns:

the resulting join
join
(SetAttribute<? super X, Y>
target of the join
set
)

Create an inner join to the specified Set-valued attribute.

public <Y> ListJoin<X, Y>

Returns:

the resulting join
join
(ListAttribute<? super X, Y>
target of the join
list
)

Create an inner join to the specified List-valued attribute.

public <K, V> MapJoin<X, K, V>

Returns:

the resulting join
join
(MapAttribute<? super X, K, V>
target of the join
map
)

Create an inner join to the specified Map-valued attribute.

public <Y> CollectionJoin<X, Y>

Returns:

the resulting join
join
(CollectionAttribute<? super X, Y>
target of the join
collection
,
JoinType
join type
jt
)

Create a join to the specified Collection-valued attribute using the given join type.

public <Y> SetJoin<X, Y>

Returns:

the resulting join
join
(SetAttribute<? super X, Y>
target of the join
set
,
JoinType
join type
jt
)

Create a join to the specified Set-valued attribute using the given join type.

public <Y> ListJoin<X, Y>

Returns:

the resulting join
join
(ListAttribute<? super X, Y>
target of the join
list
,
JoinType
join type
jt
)

Create a join to the specified List-valued attribute using the given join type.

public <K, V> MapJoin<X, K, V>

Returns:

the resulting join
join
(MapAttribute<? super X, K, V>
target of the join
map
,
JoinType
join type
jt
)

Create a join to the specified Map-valued attribute using the given join type.

public <X, Y> Join<X, Y>

Returns:

the resulting join
join
(String
name of the attribute for the target of the join
attributeName
)

Create an inner join to the specified attribute.

public <X, Y> Join<X, Y>

Returns:

the resulting join
join
(String
name of the attribute for the target of the join
attributeName
,
JoinType
join type
jt
)

Create a join to the specified attribute using the given join type.

public <X, Y> CollectionJoin<X, Y>

Returns:

the resulting join
joinCollection
(String
name of the attribute for the target of the join
attributeName
)

Create an inner join to the specified Collection-valued attribute.

public <X, Y> CollectionJoin<X, Y>

Returns:

the resulting join
joinCollection
(String
name of the attribute for the target of the join
attributeName
,
JoinType
join type
jt
)

Create a join to the specified Collection-valued attribute using the given join type.

public <X, Y> ListJoin<X, Y>

Returns:

the resulting join
joinList
(String
name of the attribute for the target of the join
attributeName
)

Create an inner join to the specified List-valued attribute.

public <X, Y> ListJoin<X, Y>

Returns:

the resulting join
joinList
(String
name of the attribute for the target of the join
attributeName
,
JoinType
join type
jt
)

Create a join to the specified List-valued attribute using the given join type.

public <X, K, V> MapJoin<X, K, V>

Returns:

the resulting join
joinMap
(String
name of the attribute for the target of the join
attributeName
)

Create an inner join to the specified Map-valued attribute.

public <X, K, V> MapJoin<X, K, V>

Returns:

the resulting join
joinMap
(String
name of the attribute for the target of the join
attributeName
,
JoinType
join type
jt
)

Create a join to the specified Map-valued attribute using the given join type.

public <X, Y> SetJoin<X, Y>

Returns:

the resulting join
joinSet
(String
name of the attribute for the target of the join
attributeName
)

Create an inner join to the specified Set-valued attribute.

public <X, Y> SetJoin<X, Y>

Returns:

the resulting join
joinSet
(String
name of the attribute for the target of the join
attributeName
,
JoinType
join type
jt
)

Create a join to the specified Set-valued attribute using the given join type.

Inherited from javax.persistence.criteria.FetchParent:
fetchfetchfetchfetchfetchfetchgetFetches
Inherited from javax.persistence.criteria.Path:
getgetgetgetgetModelgetParentPathtype

Method Detail

getCorrelationParentback to summary
public From<Z, X> getCorrelationParent()

Returns the parent From object from which the correlated From object has been obtained through correlation (use of a Subquery correlate method).

Returns:From<Z, X>

the parent of the correlated From object

Exceptions
IllegalStateException:
if the From object has not been obtained through correlation
getJoinsback to summary
public 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.

Returns:Set<Join<X, ?>>

joins made from this type

isCorrelatedback to summary
public boolean isCorrelated()

Whether the From object has been obtained as a result of correlation (use of a Subquery correlate method).

Returns:boolean

boolean indicating whether the object has been obtained through correlation

joinback to summary
public <Y> Join<X, Y> join(SingularAttribute<? super X, Y> attribute)

Create an inner join to the specified single-valued attribute.

Parameters
attribute:SingularAttribute<? super X, Y>

target of the join

Returns:Join<X, Y>

the resulting join

joinback to summary
public <Y> Join<X, Y> join(SingularAttribute<? super X, Y> attribute, JoinType jt)

Create a join to the specified single-valued attribute using the given join type.

Parameters
attribute:SingularAttribute<? super X, Y>

target of the join

jt:JoinType

join type

Returns:Join<X, Y>

the resulting join

joinback to summary
public <Y> CollectionJoin<X, Y> join(CollectionAttribute<? super X, Y> collection)

Create an inner join to the specified Collection-valued attribute.

Parameters
collection:CollectionAttribute<? super X, Y>

target of the join

Returns:CollectionJoin<X, Y>

the resulting join

joinback to summary
public <Y> SetJoin<X, Y> join(SetAttribute<? super X, Y> set)

Create an inner join to the specified Set-valued attribute.

Parameters
set:SetAttribute<? super X, Y>

target of the join

Returns:SetJoin<X, Y>

the resulting join

joinback to summary
public <Y> ListJoin<X, Y> join(ListAttribute<? super X, Y> list)

Create an inner join to the specified List-valued attribute.

Parameters
list:ListAttribute<? super X, Y>

target of the join

Returns:ListJoin<X, Y>

the resulting join

joinback to summary
public <K, V> MapJoin<X, K, V> join(MapAttribute<? super X, K, V> map)

Create an inner join to the specified Map-valued attribute.

Parameters
map:MapAttribute<? super X, K, V>

target of the join

Returns:MapJoin<X, K, V>

the resulting join

joinback to summary
public <Y> CollectionJoin<X, Y> join(CollectionAttribute<? super X, Y> collection, JoinType jt)

Create a join to the specified Collection-valued attribute using the given join type.

Parameters
collection:CollectionAttribute<? super X, Y>

target of the join

jt:JoinType

join type

Returns:CollectionJoin<X, Y>

the resulting join

joinback to summary
public <Y> SetJoin<X, Y> join(SetAttribute<? super X, Y> set, JoinType jt)

Create a join to the specified Set-valued attribute using the given join type.

Parameters
set:SetAttribute<? super X, Y>

target of the join

jt:JoinType

join type

Returns:SetJoin<X, Y>

the resulting join

joinback to summary
public <Y> ListJoin<X, Y> join(ListAttribute<? super X, Y> list, JoinType jt)

Create a join to the specified List-valued attribute using the given join type.

Parameters
list:ListAttribute<? super X, Y>

target of the join

jt:JoinType

join type

Returns:ListJoin<X, Y>

the resulting join

joinback to summary
public <K, V> MapJoin<X, K, V> join(MapAttribute<? super X, K, V> map, JoinType jt)

Create a join to the specified Map-valued attribute using the given join type.

Parameters
map:MapAttribute<? super X, K, V>

target of the join

jt:JoinType

join type

Returns:MapJoin<X, K, V>

the resulting join

joinback to summary
public <X, Y> Join<X, Y> join(String attributeName)

Create an inner join to the specified attribute.

Parameters
attributeName:String

name of the attribute for the target of the join

Returns:Join<X, Y>

the resulting join

Exceptions
IllegalArgumentException:
if attribute of the given name does not exist
joinback to summary
public <X, Y> Join<X, Y> join(String attributeName, JoinType jt)

Create a join to the specified attribute using the given join type.

Parameters
attributeName:String

name of the attribute for the target of the join

jt:JoinType

join type

Returns:Join<X, Y>

the resulting join

Exceptions
IllegalArgumentException:
if attribute of the given name does not exist
joinCollectionback to summary
public <X, Y> CollectionJoin<X, Y> joinCollection(String attributeName)

Create an inner join to the specified Collection-valued attribute.

Parameters
attributeName:String

name of the attribute for the target of the join

Returns:CollectionJoin<X, Y>

the resulting join

Exceptions
IllegalArgumentException:
if attribute of the given name does not exist
joinCollectionback to summary
public <X, Y> CollectionJoin<X, Y> joinCollection(String attributeName, JoinType jt)

Create a join to the specified Collection-valued attribute using the given join type.

Parameters
attributeName:String

name of the attribute for the target of the join

jt:JoinType

join type

Returns:CollectionJoin<X, Y>

the resulting join

Exceptions
IllegalArgumentException:
if attribute of the given name does not exist
joinListback to summary
public <X, Y> ListJoin<X, Y> joinList(String attributeName)

Create an inner join to the specified List-valued attribute.

Parameters
attributeName:String

name of the attribute for the target of the join

Returns:ListJoin<X, Y>

the resulting join

Exceptions
IllegalArgumentException:
if attribute of the given name does not exist
joinListback to summary
public <X, Y> ListJoin<X, Y> joinList(String attributeName, JoinType jt)

Create a join to the specified List-valued attribute using the given join type.

Parameters
attributeName:String

name of the attribute for the target of the join

jt:JoinType

join type

Returns:ListJoin<X, Y>

the resulting join

Exceptions
IllegalArgumentException:
if attribute of the given name does not exist
joinMapback to summary
public <X, K, V> MapJoin<X, K, V> joinMap(String attributeName)

Create an inner join to the specified Map-valued attribute.

Parameters
attributeName:String

name of the attribute for the target of the join

Returns:MapJoin<X, K, V>

the resulting join

Exceptions
IllegalArgumentException:
if attribute of the given name does not exist
joinMapback to summary
public <X, K, V> 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:String

name of the attribute for the target of the join

jt:JoinType

join type

Returns:MapJoin<X, K, V>

the resulting join

Exceptions
IllegalArgumentException:
if attribute of the given name does not exist
joinSetback to summary
public <X, Y> SetJoin<X, Y> joinSet(String attributeName)

Create an inner join to the specified Set-valued attribute.

Parameters
attributeName:String

name of the attribute for the target of the join

Returns:SetJoin<X, Y>

the resulting join

Exceptions
IllegalArgumentException:
if attribute of the given name does not exist
joinSetback to summary
public <X, Y> SetJoin<X, Y> joinSet(String attributeName, JoinType jt)

Create a join to the specified Set-valued attribute using the given join type.

Parameters
attributeName:String

name of the attribute for the target of the join

jt:JoinType

join type

Returns:SetJoin<X, Y>

the resulting join

Exceptions
IllegalArgumentException:
if attribute of the given name does not exist