javax.persistence.criteria.ParameterExpression - JPA interface
javax.persistence.criteria
Interface ParameterExpression<T>
- Superinterfaces:
- Expression<T>, Parameter<T>, Selection<T>, TupleElement<T>
Type of criteria query parameter expressions.
- Since:
- JPA 2.0
Selection<X> alias(String name)
Assigns an alias to the selection item. Once assigned, an alias cannot be changed or reassigned. Returns the same selection item.
- Parameters:
-
name
- alias
- Returns:
- selection item
- Since:
- JPA 2.0
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
- intended type of the expression
- Returns:
- new expression of the given type
- Since:
- JPA 2.0
String getAlias()
Return the alias assigned to the tuple element or null, if no alias has been assigned.
- Returns:
- alias
- Since:
- JPA 2.0
List< Selection<?>> getCompoundSelectionItems()
Return the selection items composing a compound selection. Modifications to the list do not affect the query.
- Returns:
- list of selection items
- Throws:
-
IllegalStateException
- if selection is not a compound selection
- Since:
- JPA 2.0
Class<?> getJavaType()
Return the Java type of the tuple element.
- Returns:
- the Java type of the tuple element
- Since:
- JPA 2.0
String getName()
Return the parameter name, or null if the parameter is not a named parameter or no name has been assigned.
- Returns:
- parameter name
- 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 Java Persistence query language queries and native queries will not be portable.
- Returns:
- the Java type of the parameter
- Throws:
-
IllegalStateException
- if invoked on a parameter obtained from a Java persistence query language query or native query when the implementation does not support this use
- Since:
- JPA 2.0
Integer getPosition()
Return the parameter position, or null if the parameter is not a positional parameter.
- Returns:
- position of parameter
- Since:
- JPA 2.0
Create a predicate to test whether the expression is a member of the argument list.
- Parameters:
-
values
- values to be tested against
- Returns:
- predicate testing for membership
- Since:
- JPA 2.0
Create a predicate to test whether the expression is a member of the collection.
- Parameters:
-
values
- collection of values to be tested against
- Returns:
- predicate testing for membership
- Since:
- JPA 2.0
Create a predicate to test whether the expression is a member of the collection.
- Parameters:
-
values
- expression corresponding to collection to be tested against
- Returns:
- predicate testing for membership
- Since:
- JPA 2.0
Create a predicate to test whether the expression is a member of the argument list.
- Parameters:
-
values
- expressions to be tested against
- Returns:
- predicate testing for membership
- Since:
- JPA 2.0
boolean isCompoundSelection()
Whether the selection item is a compound selection.
- Returns:
- boolean indicating whether the selection is a compound selection
- Since:
- JPA 2.0
Create a predicate to test whether the expression is not null.
- Returns:
- predicate testing whether the expression is not null
- Since:
- JPA 2.0
Create a predicate to test whether the expression is null.
- Returns:
- predicate testing whether the expression is null
- Since:
- JPA 2.0