public class SimpleCaseExpression<C,R> extends ExpressionImpl<R> implements CriteriaBuilder.SimpleCase<C,R>, Serializable
CASE [expression] WHEN [firstCondition] THEN [firstResult] WHEN [secondCondition] THEN [secondResult] ELSE [defaultResult] END
Modifier and Type | Class and Description |
---|---|
class |
SimpleCaseExpression.WhenClause |
ParameterContainer.Helper
Constructor and Description |
---|
SimpleCaseExpression(CriteriaBuilderImpl criteriaBuilder,
Class<R> javaType,
Expression<? extends C> expression) |
Modifier and Type | Method and Description |
---|---|
Expression<C> |
getExpression()
Return the expression to be tested against the
conditions.
|
Expression<? extends R> |
getOtherwiseResult() |
List<SimpleCaseExpression.WhenClause> |
getWhenClauses() |
Expression<R> |
otherwise(Expression<? extends R> result)
Add an "else" clause to the case expression.
|
Expression<R> |
otherwise(R result)
Add an "else" clause to the case expression.
|
void |
registerParameters(ParameterRegistry registry)
Register any parameters contained within this query component with the given registry.
|
String |
render(CriteriaQueryCompiler.RenderingContext renderingContext) |
String |
renderProjection(CriteriaQueryCompiler.RenderingContext renderingContext) |
CriteriaBuilder.SimpleCase<C,R> |
when(C condition,
Expression<? extends R> result)
Add a when/then clause to the case expression.
|
CriteriaBuilder.SimpleCase<C,R> |
when(C condition,
R result)
Add a when/then clause to the case expression.
|
as, asBigDecimal, asBigInteger, asDouble, asFloat, asInteger, asLong, asString, in, in, in, in, isNotNull, isNull
alias, getCompoundSelectionItems, getValueHandlers, isCompoundSelection
forceConversion, getAlias, getJavaType, getValueHandler, resetJavaType, setAlias
criteriaBuilder
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
as, in, in, in, in, isNotNull, isNull
alias, getCompoundSelectionItems, isCompoundSelection
getAlias, getJavaType
getValueHandlers
getValueHandler
public SimpleCaseExpression(CriteriaBuilderImpl criteriaBuilder, Class<R> javaType, Expression<? extends C> expression)
public Expression<C> getExpression()
CriteriaBuilder.SimpleCase
getExpression
in interface CriteriaBuilder.SimpleCase<C,R>
public CriteriaBuilder.SimpleCase<C,R> when(C condition, R result)
CriteriaBuilder.SimpleCase
when
in interface CriteriaBuilder.SimpleCase<C,R>
condition
- "when" conditionresult
- "then" result valuepublic CriteriaBuilder.SimpleCase<C,R> when(C condition, Expression<? extends R> result)
CriteriaBuilder.SimpleCase
when
in interface CriteriaBuilder.SimpleCase<C,R>
condition
- "when" conditionresult
- "then" result expressionpublic Expression<R> otherwise(R result)
CriteriaBuilder.SimpleCase
otherwise
in interface CriteriaBuilder.SimpleCase<C,R>
result
- "else" resultpublic Expression<R> otherwise(Expression<? extends R> result)
CriteriaBuilder.SimpleCase
otherwise
in interface CriteriaBuilder.SimpleCase<C,R>
result
- "else" result expressionpublic Expression<? extends R> getOtherwiseResult()
public List<SimpleCaseExpression.WhenClause> getWhenClauses()
public void registerParameters(ParameterRegistry registry)
ParameterContainer
registerParameters
in interface ParameterContainer
registry
- The parameter registry with which to register.public String render(CriteriaQueryCompiler.RenderingContext renderingContext)
render
in interface Renderable
public String renderProjection(CriteriaQueryCompiler.RenderingContext renderingContext)
renderProjection
in interface Renderable
Copyright © 2018 JBoss by Red Hat. All rights reserved.