Package jakarta.persistence.criteria
Interface CriteriaBuilder.Case<R>
- All Superinterfaces:
Expression<R>
,Selection<R>
,TupleElement<R>
- Enclosing interface:
- CriteriaBuilder
Interface used to build general case expressions.
Case conditions are evaluated in the order in which
they are specified.
-
Method Summary
Modifier and TypeMethodDescriptionotherwise
(Expression<? extends R> result) Add an "else" clause to the case expression.Add an "else" clause to the case expression.when
(Expression<Boolean> condition, Expression<? extends R> result) Add a when/then clause to the case expression.when
(Expression<Boolean> condition, R result) Add a when/then clause to the case expression.Methods inherited from interface jakarta.persistence.criteria.Expression
as, in, in, in, in, isNotNull, isNull
Methods inherited from interface jakarta.persistence.criteria.Selection
alias, getCompoundSelectionItems, isCompoundSelection
Methods inherited from interface jakarta.persistence.TupleElement
getAlias, getJavaType
-
Method Details
-
when
Add a when/then clause to the case expression.- Parameters:
condition
- "when" conditionresult
- "then" result value- Returns:
- general case expression
-
when
Add a when/then clause to the case expression.- Parameters:
condition
- "when" conditionresult
- "then" result expression- Returns:
- general case expression
-
otherwise
Add an "else" clause to the case expression.- Parameters:
result
- "else" result- Returns:
- expression
-
otherwise
Add an "else" clause to the case expression.- Parameters:
result
- "else" result expression- Returns:
- expression
-