Coalesce
- Super Interfaces:
Expression<T>,Selection<T>,TupleElement<T>
Interface used to build coalesce expressions. A coalesce expression is equivalent to a case expression that returns null if all its arguments evaluate to null, and the value of its first non-null argument otherwise.
- Since:
- JPA 2.0
Public Methods
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
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
- Parameters:
value- expression to be tested against
- Return:
- predicate testing for equality
- Inherited from:
Expression<T>
- Since:
- JPA 3.2
- Parameters:
value- value to be tested against
- Return:
- predicate testing for equality
- Inherited from:
Expression<T>
- Since:
- JPA 3.2
- Parameters:
values- collection of values to be tested against
- Return:
- predicate testing for membership
- Inherited from:
Expression<T>
- Since:
- JPA 2.0
- Parameters:
values- expressions to be tested against
- Return:
- predicate testing for membership
- Inherited from:
Expression<T>
- Since:
- JPA 2.0
- Parameters:
values- expression corresponding to collection to be tested against
- Return:
- predicate testing for membership
- Inherited from:
Expression<T>
- Since:
- JPA 2.0
- Parameters:
values- values to be tested against
- Return:
- predicate testing for membership
- Inherited from:
Expression<T>
- Since:
- JPA 2.0
- Return:
- predicate testing whether the expression is not null
- Inherited from:
Expression<T>
- Since:
- JPA 2.0
- Parameters:
value- expression to be tested against
- Return:
- predicate testing for inequality
- Inherited from:
Expression<T>
- Since:
- JPA 3.2
- Parameters:
value- value to be tested against
- Return:
- predicate testing for inequality
- Inherited from:
Expression<T>
- Since:
- JPA 3.2
CriteriaBuilder.Coalesce<T> value(Expression<?extendsT> value)
- Parameters:
value- expression
- Return:
- coalesce expression
- Since:
- JPA 2.0
CriteriaBuilder.Coalesce<T> value(T value)
- Parameters:
value- value
- Return:
- coalesce expression
- Since:
- JPA 2.0