JPA Interface

ParameterExpression

Type Parameters:
<T> - the type of the parameter expression
Super Interfaces:
Expression<T>, Parameter<T>, Selection<T>, TupleElement<T>

Type of criteria query parameter expressions.
Since:
JPA 2.0

Public Methods

Expression<X> as(Class<X> type)
Perform a typecast upon the expression, returning a new expression object.
Unlike cast(), this method does not cause type conversion: the runtime type is not changed.

Warning: may result in a runtime failure.

Parameters:
type - intended type of the expression
Return:
new expression of the given type
Inherited from:
Expression<T>
See Also:
cast()
Since:
JPA 2.0
Expression<X> cast(Class<X> type)
Cast this expression to the specified type, returning a new expression object.
Unlike 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.

Parameters:
type - a basic type
Return:
a scalar expression of the given basic type
Inherited from:
Expression<T>
Since:
JPA 3.2
Create a predicate to test whether the expression is equal to the argument.
Parameters:
value - expression to be tested against
Return:
predicate testing for equality
Inherited from:
Expression<T>
Since:
JPA 3.2
Predicate equalTo(Object value)
Create a predicate to test whether the expression is equal to the argument.
Parameters:
value - value to be tested against
Return:
predicate testing for equality
Inherited from:
Expression<T>
Since:
JPA 3.2
String getName()
Return the parameter name, or null if the parameter is not a named parameter or no name has been assigned.
Return:
parameter name
Inherited from:
Parameter<T>
Since:
JPA 2.0
Class<T> getParameterType()
Return the Java type of the parameter.
Values bound to the parameter must be assignable to this type. This method is required to be supported for criteria queries only. Applications that use this method for Jakarta Persistence query language queries and native queries will not be portable.
Return:
the Java type of the parameter
Throws:
IllegalStateException - if invoked on a parameter obtained from a query language query or native query when the implementation does not support this usage
Inherited from:
Parameter<T>
Since:
JPA 2.0
Integer getPosition()
Return the parameter position, or null if the parameter is not a positional parameter.
Return:
position of parameter
Inherited from:
Parameter<T>
Since:
JPA 2.0
Predicate in(Collection<?> values)
Create a predicate to test whether the expression is a member of the collection.
Parameters:
values - collection of values to be tested against
Return:
predicate testing for membership
Inherited from:
Expression<T>
Since:
JPA 2.0
Predicate in(Expression<?>... values)
Create a predicate to test whether the expression is a member of the argument list.
Parameters:
values - expressions to be tested against
Return:
predicate testing for membership
Inherited from:
Expression<T>
Since:
JPA 2.0
Predicate in(Expression<Collection<?>> values)
Create a predicate to test whether the expression is a member of the collection.
Parameters:
values - expression corresponding to collection to be tested against
Return:
predicate testing for membership
Inherited from:
Expression<T>
Since:
JPA 2.0
Predicate in(Object... values)
Create a predicate to test whether the expression is a member of the argument list.
Parameters:
values - values to be tested against
Return:
predicate testing for membership
Inherited from:
Expression<T>
Since:
JPA 2.0
Create a predicate to test whether the expression is not null.
Return:
predicate testing whether the expression is not null
Inherited from:
Expression<T>
Since:
JPA 2.0
Create a predicate to test whether the expression is null.
Return:
predicate testing whether the expression is null
Inherited from:
Expression<T>
Since:
JPA 2.0
Create a predicate to test whether the expression is unequal to the argument.
Parameters:
value - expression to be tested against
Return:
predicate testing for inequality
Inherited from:
Expression<T>
Since:
JPA 3.2
Predicate notEqualTo(Object value)
Create a predicate to test whether the expression is unequal to the argument.
Parameters:
value - value to be tested against
Return:
predicate testing for inequality
Inherited from:
Expression<T>
Since:
JPA 3.2