use of org.eclipse.persistence.internal.expressions.ArgumentListFunctionExpression in project eclipselink by eclipse-ee4j.
the class CriteriaBuilderImpl method coalesce.
/**
* Create an expression that returns null if all its arguments evaluate to
* null, and the value of the first non-null argument otherwise.
*
* @param x
* expression
* @param y
* value
* @return coalesce expression
*/
@Override
public <Y> Expression<Y> coalesce(Expression<? extends Y> x, Y y) {
ArgumentListFunctionExpression coalesce = ((InternalSelection) x).getCurrentNode().coalesce();
org.eclipse.persistence.expressions.Expression expX = ((InternalSelection) x).getCurrentNode();
expX = org.eclipse.persistence.expressions.Expression.from(expX, coalesce);
coalesce.addChild(expX);
org.eclipse.persistence.expressions.Expression expY = org.eclipse.persistence.expressions.Expression.from(y, new ExpressionBuilder());
coalesce.addChild(expY);
return new CoalesceImpl(metamodel, x.getJavaType(), coalesce, buildList(x, internalLiteral(y)), "coalesce");
}
Aggregations