/** * INTERNAL: * Add a child and ensure it is the rightmost in the tree as long as it * is in the tree * If there is already a node that is set as therightmost node, replace it * @param argument */ public synchronized void addRightMostChild(Expression argument){ if (hasLastChild != null && hasLastChild.booleanValue()){ getChildren().remove(super.getChildren().size() - 1); super.addChild(argument); } else { this.addChild(argument); } this.hasLastChild = Boolean.valueOf(true); }
/** * INTERNAL: * Add a child and ensure it is the rightmost in the tree as long as it * is in the tree * If there is already a node that is set as therightmost node, replace it * @param argument */ public synchronized void addRightMostChild(Expression argument){ if (hasLastChild != null && hasLastChild.booleanValue()){ getChildren().remove(super.getChildren().size() - 1); super.addChild(argument); } else { this.addChild(argument); } this.hasLastChild = Boolean.TRUE; }
/** * INTERNAL: * Add a child and ensure it is the rightmost in the tree as long as it * is in the tree * If there is already a node that is set as therightmost node, replace it * @param argument */ public synchronized void addRightMostChild(Expression argument){ if (hasLastChild != null && hasLastChild.booleanValue()){ getChildren().remove(super.getChildren().size() - 1); super.addChild(argument); } else { this.addChild(argument); } this.hasLastChild = Boolean.TRUE; }
/** * 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 * expression * @return expression corresponding to the given coalesce expression */ public <Y> Expression<Y> coalesce(Expression<? extends Y> x, Expression<? extends Y> y){ ArgumentListFunctionExpression coalesce = ((InternalSelection)x).getCurrentNode().coalesce(); coalesce.addChild(((InternalSelection)x).getCurrentNode()); coalesce.addChild(((InternalSelection)y).getCurrentNode()); return new CoalesceImpl(metamodel, x.getJavaType(), coalesce, buildList(x, y), "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 */ public <Y> Expression<Y> coalesce(Expression<? extends Y> x, Y y){ ArgumentListFunctionExpression coalesce = ((InternalSelection)x).getCurrentNode().coalesce(); coalesce.addChild(((InternalSelection)x).getCurrentNode()); coalesce.addChild(((InternalSelection)y).getCurrentNode()); return new CoalesceImpl(metamodel, x.getJavaType(), coalesce, buildList(x, internalLiteral(y)), "coalesce"); }
if (iterator.hasNext()){ Expression base = Expression.from(iterator.next(), this); expression.addChild(base); expression.setBaseExpression(base);//base needs to be the same as the first child for reportQuery items. while (iterator.hasNext()) { expression.addChild(Expression.from(iterator.next(), this));