return otherwise(new Expressions.Constant<R>(otherwise));
}
@Override
public org.apache.openjpa.kernel.exps.Value toValue(ExpressionFactory factory, CriteriaQueryImpl<?> q) {
Value caseOperandExpr = Expressions.toValue((ExpressionImpl<?>)caseOperand, factory, q);
int size = whens.size();
org.apache.openjpa.kernel.exps.Expression[] exps = new org.apache.openjpa.kernel.exps.Expression[size];
for (int i = 0; i < size; i++) {
Value when = Expressions.toValue((ExpressionImpl<C>)whens.get(i), factory, q);
Value action = Expressions.toValue((ExpressionImpl<?>)thens.get(i), factory, q);
exps[i] = factory.whenScalar(when, action);
}
Value other = Expressions.toValue((ExpressionImpl<?>)otherwise, factory, q);
return factory.simpleCaseExpression(caseOperandExpr, exps, other);
}