@Override public String visit(BetweenOperator operator) { StringBuilder sb = new StringBuilder(); ValueRange range = operator.getArgument(); if (!range.isIncludeLower() || !range.isIncludeUpper()) { // if any of the bounds are not included then we cannot use BETWEEN and need to resort to comparison appendAttributePath(sb, operator.getAttributeCondition()); sb.append(operator.getAttributeCondition().isNegated() ? (range.isIncludeLower() ? " < " : " <= ") : (range.isIncludeLower() ? " >= " : " > ")); appendArgument(sb, range.getFrom()); sb.append(operator.getAttributeCondition().isNegated() ? " OR " : " AND "); appendAttributePath(sb, operator.getAttributeCondition()); sb.append(operator.getAttributeCondition().isNegated() ? (range.isIncludeUpper() ? " > " : " >= ") : (range.isIncludeUpper() ? " <= " : " < ")); appendArgument(sb, range.getTo()); } else { // if the bounds are included then we can use BETWEEN if (operator.getAttributeCondition().isNegated()) { sb.append("NOT "); } appendAttributePath(sb, operator.getAttributeCondition()); sb.append(" BETWEEN "); appendArgument(sb, range.getFrom()); sb.append(" AND "); appendArgument(sb, range.getTo()); } return sb.toString(); }
StringBuilder sb = new StringBuilder(); ValueRange range = operator.getArgument(); if (!range.isIncludeLower() || !range.isIncludeUpper()) { appendAttributePath(sb, operator.getAttributeCondition()); sb.append(operator.getAttributeCondition().isNegated() ? (range.isIncludeUpper() ? " > " : " >= ") : (range.isIncludeUpper() ? " <= " : " < ")); appendArgument(sb, range.getTo()); if (wrap) {