/** */ public Object newBetween(int line, int column, boolean not, Object arg, Object lower, Object upper) { BetweenNode node = new BetweenNode(); node.setLeft((Node)arg); node.setRightForBetween((Node)lower); node.setRightForAnd((Node)upper); setPosition(node, line, column); return not? newNot(line, column, node) : node; }
/** * INTERNAL * Return a EclipseLink expression by 'BETWEEN' and 'AND'ing the expressions from the left, * rightForBetween and rightForAnd nodes */ public Expression generateExpression(GenerationContext context) { // Get the left expression Expression whereClause = getLeft().generateExpression(context); // Between it with whatever the rightForBetween expression and rightForAnd expressions are whereClause = whereClause.between(getRightForBetween().generateExpression(context), getRightForAnd().generateExpression(context)); // and return the expression... return whereClause; }
/** * INTERNAL * Validate node and calculate its type. */ public void validate(ParseTreeContext context) { Object type = null; if (left != null) { left.validate(context); type = left.getType(); } if (rightForBetween != null) { rightForBetween.validate(context); rightForBetween.validateParameter(context, type); } if (rightForAnd != null) { rightForAnd.validate(context); rightForAnd.validateParameter(context, type); } TypeHelper typeHelper = context.getTypeHelper(); setType(typeHelper.getBooleanType()); }
/** * INTERNAL * Validate node and calculate its type. */ public void validate(ParseTreeContext context) { Object type = null; if (left != null) { left.validate(context); type = left.getType(); } if (rightForBetween != null) { rightForBetween.validate(context); rightForBetween.validateParameter(context, type); } if (rightForAnd != null) { rightForAnd.validate(context); rightForAnd.validateParameter(context, type); } TypeHelper typeHelper = context.getTypeHelper(); setType(typeHelper.getBooleanType()); }
/** */ public Object newBetween(int line, int column, boolean not, Object arg, Object lower, Object upper) { BetweenNode node = new BetweenNode(); node.setLeft((Node)arg); node.setRightForBetween((Node)lower); node.setRightForAnd((Node)upper); setPosition(node, line, column); return not? newNot(line, column, node) : node; }
/** * INTERNAL * Return a EclipseLink expression by 'BETWEEN' and 'AND'ing the expressions from the left, * rightForBetween and rightForAnd nodes */ public Expression generateExpression(GenerationContext context) { // Get the left expression Expression whereClause = getLeft().generateExpression(context); // Between it with whatever the rightForBetween expression and rightForAnd expressions are whereClause = whereClause.between(getRightForBetween().generateExpression(context), getRightForAnd().generateExpression(context)); // and return the expression... return whereClause; }
/** * INTERNAL * Validate node and calculate its type. */ public void validate(ParseTreeContext context) { Object type = null; if (left != null) { left.validate(context); type = left.getType(); } if (rightForBetween != null) { rightForBetween.validate(context); rightForBetween.validateParameter(context, type); } if (rightForAnd != null) { rightForAnd.validate(context); rightForAnd.validateParameter(context, type); } TypeHelper typeHelper = context.getTypeHelper(); setType(typeHelper.getBooleanType()); }
/** */ public Object newBetween(int line, int column, boolean not, Object arg, Object lower, Object upper) { BetweenNode node = new BetweenNode(); node.setLeft((Node)arg); node.setRightForBetween((Node)lower); node.setRightForAnd((Node)upper); setPosition(node, line, column); return not? newNot(line, column, node) : node; }
/** * INTERNAL * Return a EclipseLink expression by 'BETWEEN' and 'AND'ing the expressions from the left, * rightForBetween and rightForAnd nodes */ public Expression generateExpression(GenerationContext context) { // Get the left expression Expression whereClause = getLeft().generateExpression(context); // Between it with whatever the rightForBetween expression and rightForAnd expressions are whereClause = whereClause.between(getRightForBetween().generateExpression(context), getRightForAnd().generateExpression(context)); // and return the expression... return whereClause; }