/** * INTERNAL: * Rebuild myself against the base, with the values of parameters supplied by the context * expression. This is used for transforming a standalone expression (e.g. the join criteria of a mapping) * into part of some larger expression. You normally would not call this directly, instead calling twist * See the comment there for more details" */ @Override public Expression twistedForBaseAndContext(Expression newBase, Expression context, Expression oldBase) { if (this.children.isEmpty()) { return (Expression)clone(); } Vector newChildren = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(this.children.size()); // For functions the base is the first child, we only want the arguments so start at the second. for (int index = 1; index < this.children.size(); index++) { newChildren.addElement(this.children.elementAt(index).twistedForBaseAndContext(newBase, context, oldBase)); } // Aply the function to the twisted old base. Expression oldBaseExp = this.children.elementAt(0); return oldBaseExp.twistedForBaseAndContext(newBase, context, oldBase).performOperator(this.operator, newChildren); }
/** * INTERNAL: * Rebuild myself against the base, with the values of parameters supplied by the context * expression. This is used for transforming a standalone expression (e.g. the join criteria of a mapping) * into part of some larger expression. You normally would not call this directly, instead calling twist * See the comment there for more details" */ @Override public Expression twistedForBaseAndContext(Expression newBase, Expression context, Expression oldBase) { if (this.children.isEmpty()) { return (Expression)clone(); } Vector newChildren = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(this.children.size()); // For functions the base is the first child, we only want the arguments so start at the second. for (int index = 1; index < this.children.size(); index++) { newChildren.addElement(((Expression)children.elementAt(index)).twistedForBaseAndContext(newBase, context, oldBase)); } // Aply the function to the twisted old base. Expression oldBaseExp = (Expression)this.children.elementAt(0); return oldBaseExp.twistedForBaseAndContext(newBase, context, oldBase).performOperator(this.operator, newChildren); }
/** * INTERNAL: * Rebuild myself against the base, with the values of parameters supplied by the context * expression. This is used for transforming a standalone expression (e.g. the join criteria of a mapping) * into part of some larger expression. You normally would not call this directly, instead calling twist * See the comment there for more details" */ public Expression twistedForBaseAndContext(Expression newBase, Expression context) { if (this.children.isEmpty()) { return (Expression)clone(); } Vector newChildren = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(this.children.size()); // For functions the base is the first child, we only want the arguments so start at the second. for (int index = 1; index < this.children.size(); index++) { newChildren.addElement(((Expression)children.elementAt(index)).twistedForBaseAndContext(newBase, context)); } // Aply the function to the twisted old base. Expression oldBase = (Expression)this.children.elementAt(0); return oldBase.twistedForBaseAndContext(newBase, context).performOperator(getOperator(), newChildren); }