Top Description Methods
javax.persistence.criteria

public Interface Expression<T>

extends Selection<T>
Known Direct Subinterfaces
javax.persistence.criteria.ParameterExpression, javax.persistence.criteria.Path, javax.persistence.criteria.Predicate, javax.persistence.criteria.Subquery, javax.persistence.criteria.CriteriaBuilder.Coalesce, javax.persistence.criteria.CriteriaBuilder.SimpleCase, javax.persistence.criteria.CriteriaBuilder.Case
Type Parameters
<T>
the type of the expression
Imports
java.util.Collection

Type for query expressions.
Since
Java Persistence 2.0

Method Summary

Modifier and TypeMethod and Description
public <X> Expression<X>

Returns:

new expression of the given type
as
(Class<X>
intended type of the expression
type
)

Perform a typecast upon the expression, returning a new expression object.

public Predicate

Returns:

predicate testing for membership
in
(Object...
values to be tested against
values
)

Create a predicate to test whether the expression is a member of the argument list.

public Predicate

Returns:

predicate testing for membership
in
(Expression<?>...
expressions to be tested against
values
)

Create a predicate to test whether the expression is a member of the argument list.

public Predicate

Returns:

predicate testing for membership
in
(Collection<?>
collection of values to be tested against
values
)

Create a predicate to test whether the expression is a member of the collection.

public Predicate

Returns:

predicate testing for membership
in
(Expression<Collection<?>>
expression corresponding to collection to be tested against
values
)

Create a predicate to test whether the expression is a member of the collection.

public Predicate

Returns:

predicate testing whether the expression is not null
isNotNull
()

Create a predicate to test whether the expression is not null.

public Predicate

Returns:

predicate testing whether the expression is null
isNull
()

Create a predicate to test whether the expression is null.

Inherited from javax.persistence.criteria.Selection:
aliasgetCompoundSelectionItemsisCompoundSelection

Method Detail

asback to summary
public <X> Expression<X> as(Class<X> type)

Perform a typecast upon the expression, returning a new expression object. This method does not cause type conversion: the runtime type is not changed.

Warning

may result in a runtime failure.

Parameters
type:Class<X>

intended type of the expression

Returns:Expression<X>

new expression of the given type

inback to summary
public Predicate in(Object... values)

Create a predicate to test whether the expression is a member of the argument list.

Parameters
values:Object[]

values to be tested against

Returns:Predicate

predicate testing for membership

inback to summary
public Predicate in(Expression<?>... values)

Create a predicate to test whether the expression is a member of the argument list.

Parameters
values:Expression<?>[]

expressions to be tested against

Returns:Predicate

predicate testing for membership

inback to summary
public Predicate in(Collection<?> values)

Create a predicate to test whether the expression is a member of the collection.

Parameters
values:Collection<?>

collection of values to be tested against

Returns:Predicate

predicate testing for membership

inback to summary
public Predicate in(Expression<Collection<?>> values)

Create a predicate to test whether the expression is a member of the collection.

Parameters
values:Expression<Collection<?>>

expression corresponding to collection to be tested against

Returns:Predicate

predicate testing for membership

isNotNullback to summary
public Predicate isNotNull()

Create a predicate to test whether the expression is not null.

Returns:Predicate

predicate testing whether the expression is not null

isNullback to summary
public Predicate isNull()

Create a predicate to test whether the expression is null.

Returns:Predicate

predicate testing whether the expression is null