public BetweenParseNode between(ParseNode l, ParseNode r1, ParseNode r2, boolean negate) { return new BetweenParseNode(l, r1, r2, negate); }
@Override public <T> T accept(ParseNodeVisitor<T> visitor) throws SQLException { List<T> l = Collections.emptyList(); if (visitor.visitEnter(this)) { l = acceptChildren(visitor); } return visitor.visitLeave(this, l); }
@Override public void toSQL(ColumnResolver resolver, StringBuilder buf) { List<ParseNode> children = getChildren(); children.get(0).toSQL(resolver, buf); if (negate) buf.append(" NOT"); buf.append(" BETWEEN "); children.get(1).toSQL(resolver, buf); buf.append(" AND "); children.get(2).toSQL(resolver, buf); } }
@Override public boolean visitEnter(BetweenParseNode node) throws SQLException{ throw new SQLFeatureNotSupportedException(node.toString()); }
@Override public ParseNode createNode(List<ParseNode> children) { if(node.isNegate()) { return NODE_FACTORY.not(NODE_FACTORY.and(children)); } else { return NODE_FACTORY.and(children); } } });
@Override public E visitLeave(BetweenParseNode node, List<E> l) throws SQLException { throw new SQLFeatureNotSupportedException(node.toString()); }
@Override public ParseNode createNode(List<ParseNode> children) { if(node.isNegate()) { return NODE_FACTORY.not(NODE_FACTORY.and(children)); } else { return NODE_FACTORY.and(children); } } });
@Override public ParseNode visitLeave(final BetweenParseNode node, List<ParseNode> nodes) throws SQLException { LessThanOrEqualParseNode lhsNode = NODE_FACTORY.lte(node.getChildren().get(1), node.getChildren().get(0)); LessThanOrEqualParseNode rhsNode = NODE_FACTORY.lte(node.getChildren().get(0), node.getChildren().get(2)); List<ParseNode> parseNodes = Lists.newArrayListWithExpectedSize(2); parseNodes.add(this.visitLeave(lhsNode, lhsNode.getChildren())); parseNodes.add(this.visitLeave(rhsNode, rhsNode.getChildren())); return super.visitLeave(node, parseNodes); }
@Override public E visitLeave(BetweenParseNode node, List<E> l) throws SQLException { throw new SQLFeatureNotSupportedException(node.toString()); }
@Override public ParseNode createNode(List<ParseNode> children) { if(node.isNegate()) { return NODE_FACTORY.not(NODE_FACTORY.and(children)); } else { return NODE_FACTORY.and(children); } } });
@Override public <T> T accept(ParseNodeVisitor<T> visitor) throws SQLException { List<T> l = Collections.emptyList(); if (visitor.visitEnter(this)) { l = acceptChildren(visitor); } return visitor.visitLeave(this, l); }
public BetweenParseNode between(ParseNode l, ParseNode r1, ParseNode r2, boolean negate) { return new BetweenParseNode(l, r1, r2, negate); }
@Override public ParseNode visitLeave(final BetweenParseNode node, List<ParseNode> nodes) throws SQLException { LessThanOrEqualParseNode lhsNode = NODE_FACTORY.lte(node.getChildren().get(1), node.getChildren().get(0)); LessThanOrEqualParseNode rhsNode = NODE_FACTORY.lte(node.getChildren().get(0), node.getChildren().get(2)); List<ParseNode> parseNodes = Lists.newArrayListWithExpectedSize(2); parseNodes.add(this.visitLeave(lhsNode, lhsNode.getChildren())); parseNodes.add(this.visitLeave(rhsNode, rhsNode.getChildren())); return super.visitLeave(node, parseNodes); }
@Override public boolean visitEnter(BetweenParseNode node) throws SQLException{ throw new SQLFeatureNotSupportedException(node.toString()); }
@Override public <T> T accept(ParseNodeVisitor<T> visitor) throws SQLException { List<T> l = Collections.emptyList(); if (visitor.visitEnter(this)) { l = acceptChildren(visitor); } return visitor.visitLeave(this, l); }
public BetweenParseNode between(ParseNode l, ParseNode r1, ParseNode r2, boolean negate) { return new BetweenParseNode(l, r1, r2, negate); }
@Override public ParseNode visitLeave(final BetweenParseNode node, List<ParseNode> nodes) throws SQLException { LessThanOrEqualParseNode lhsNode = NODE_FACTORY.lte(node.getChildren().get(1), node.getChildren().get(0)); LessThanOrEqualParseNode rhsNode = NODE_FACTORY.lte(node.getChildren().get(0), node.getChildren().get(2)); List<ParseNode> parseNodes = Lists.newArrayListWithExpectedSize(2); parseNodes.add(this.visitLeave(lhsNode, lhsNode.getChildren())); parseNodes.add(this.visitLeave(rhsNode, rhsNode.getChildren())); return super.visitLeave(node, parseNodes); }
@Override public boolean visitEnter(BetweenParseNode node) throws SQLException{ throw new SQLFeatureNotSupportedException(node.toString()); }
@Override public void toSQL(ColumnResolver resolver, StringBuilder buf) { List<ParseNode> children = getChildren(); children.get(0).toSQL(resolver, buf); if (negate) buf.append(" NOT"); buf.append(" BETWEEN "); children.get(1).toSQL(resolver, buf); buf.append(" AND "); children.get(2).toSQL(resolver, buf); } }
@Override public E visitLeave(BetweenParseNode node, List<E> l) throws SQLException { throw new SQLFeatureNotSupportedException(node.toString()); }