@Override public Object visit(final ASTBETWEEN node, final Object data) { final Object value = node.jjtGetChild(0).jjtAccept(this, data); final Object startValue = node.jjtGetChild(1).jjtAccept(this, data); final Object endValue = node.jjtGetChild(2).jjtAccept(this, data); final boolean compare1 = compare(Compare.GTE, value, startValue); final boolean compare2 = compare(Compare.LTE, value, endValue); final boolean result = compare1 && compare2; return node.not != result; }
final public void BetweenEval() throws ParseException {/*@bgen(jjtree) BETWEEN */ ASTBETWEEN jjtn000 = new ASTBETWEEN(JJTBETWEEN); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000);
final public void BetweenEval() throws ParseException {/*@bgen(jjtree) BETWEEN */ ASTBETWEEN jjtn000 = new ASTBETWEEN(JJTBETWEEN); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000);
@Override public Object visit(final ASTBETWEEN node, final Object data) { final Object value = node.jjtGetChild(0).jjtAccept(this, data); final Object startValue = node.jjtGetChild(1).jjtAccept(this, data); final Object endValue = node.jjtGetChild(2).jjtAccept(this, data); final String compare1 = createSqlCriteria(value, startValue, node.not ? Compare.LT : Compare.GTE, false); final String compare2 = createSqlCriteria(value, endValue, node.not ? Compare.GT : Compare.LTE, false); return String.format("(%s %s %s)", compare1, node.not ? "or" : "and", compare2); }
@Override public Object visit(final ASTBETWEEN node, final Object data) { final Object value = node.jjtGetChild(0).jjtAccept(this, data); final Object startValue = node.jjtGetChild(1).jjtAccept(this, data); final Object endValue = node.jjtGetChild(2).jjtAccept(this, data); final String compare1 = createSqlCriteria(value, startValue, node.not ? Compare.LT : Compare.GTE, false); final String compare2 = createSqlCriteria(value, endValue, node.not ? Compare.GT : Compare.LTE, false); return String.format("(%s %s %s)", compare1, node.not ? "or" : "and", compare2); }
@Override public Object visit(final ASTBETWEEN node, final Object data) { final Object value = node.jjtGetChild(0).jjtAccept(this, data); final Object startValue = node.jjtGetChild(1).jjtAccept(this, data); final Object endValue = node.jjtGetChild(2).jjtAccept(this, data); final boolean compare1 = compare(Compare.GTE, value, startValue); final boolean compare2 = compare(Compare.LTE, value, endValue); final boolean result = compare1 && compare2; return node.not != result; }
@Override public Object visit(final ASTBETWEEN node, final Object data) { final Object value = node.jjtGetChild(0).jjtAccept(this, data); final Object startValue = node.jjtGetChild(1).jjtAccept(this, data); final Object endValue = node.jjtGetChild(2).jjtAccept(this, data); final Expression compare1 = createIcebergExpression(value, startValue, node.not ? Compare.LT : Compare.GTE); final Expression compare2 = createIcebergExpression(value, endValue, node.not ? Compare.GT : Compare.LTE); return (node.not) ? Expressions.or(compare1, compare2) : Expressions.and(compare1, compare2); }
@Override public Object visit(final ASTBETWEEN node, final Object data) { final Object value = node.jjtGetChild(0).jjtAccept(this, data); final Object startValue = node.jjtGetChild(1).jjtAccept(this, data); final Object endValue = node.jjtGetChild(2).jjtAccept(this, data); final Expression compare1 = createIcebergExpression(value, startValue, node.not ? Compare.LT : Compare.GTE); final Expression compare2 = createIcebergExpression(value, endValue, node.not ? Compare.GT : Compare.LTE); return (node.not) ? Expressions.or(compare1, compare2) : Expressions.and(compare1, compare2); }