protected SetCriteria setCriteria( DynamicOperand operand, Collection<? extends StaticOperand> values ) { return new SetCriteria(operand, values); }
protected static Set<?> literalValues( SetCriteria setCriteria, QueryContext context, TypeFactory<?> type ) { Set<Object> values = new HashSet<>(); for (Object value : setCriteria.getValues()) { if (value instanceof StaticOperand) { Object literal = literalValue((StaticOperand)value, context, type); if (literal instanceof Collection) { for (Object v : (Collection<?>)literal) { if (v != null) values.add(type.create(v)); } values.addAll((Collection<?>)literal); } else if (literal instanceof Object[]) { for (Object v : (Object[])literal) { if (v != null) values.add(type.create(v)); } } else if (literal != null) { values.add(type.create(literal)); } } } return values; }
@Override public void visit( SetCriteria setCriteria ) { strategy.visit(setCriteria); enqueue(setCriteria.leftOperand()); for (StaticOperand right : setCriteria.rightOperands()) { enqueue(right); } visitNext(); }
DynamicOperand operand = set.leftOperand(); DynamicOperand newOperand = rewrite(context, operand); if (newOperand != operand) { return new SetCriteria(newOperand, set.rightOperands());
DynamicOperand operand = criteria.getOperand(); if (isPathOriented(operand)) { return new SetCriteria(operand, criteria.rightOperands());
@Override public Collection<? extends javax.jcr.query.qom.StaticOperand> getValues() { return rightOperands(); }
@Override public DynamicOperand getOperand() { return leftOperand(); }
DynamicOperand operand = setCriteria.getOperand(); final TypeFactory<?> defaultType = determineType(operand, context, columns);
DynamicOperand operand = set.leftOperand(); DynamicOperand newOperand = rewrite(context, operand); if (newOperand != operand) { return new SetCriteria(newOperand, set.rightOperands());
DynamicOperand operand = criteria.getOperand(); if (isPathOriented(operand)) { return new SetCriteria(operand, criteria.rightOperands());
@Override public Collection<? extends javax.jcr.query.qom.StaticOperand> getValues() { return rightOperands(); }
@Override public DynamicOperand getOperand() { return leftOperand(); }
DynamicOperand operand = setCriteria.getOperand(); final TypeFactory<?> defaultType = determineType(operand, context, columns);
DynamicOperand lhs = replaceAliasesWithProperties(context, criteria.leftOperand(), propertyByAlias); if (lhs == criteria.leftOperand()) return criteria; return new SetCriteria(lhs, criteria.rightOperands());
protected SetCriteria setCriteria( DynamicOperand operand, Collection<? extends StaticOperand> values ) { return new SetCriteria(operand, values); }
@Override public void visit( SetCriteria setCriteria ) { strategy.visit(setCriteria); enqueue(setCriteria.leftOperand()); for (StaticOperand right : setCriteria.rightOperands()) { enqueue(right); } visitNext(); }
protected static Set<?> literalValues( SetCriteria setCriteria, QueryContext context, TypeFactory<?> type ) { Set<Object> values = new HashSet<>(); for (Object value : setCriteria.getValues()) { if (value instanceof StaticOperand) { Object literal = literalValue((StaticOperand)value, context, type); if (literal instanceof Collection) { for (Object v : (Collection<?>)literal) { if (v != null) values.add(type.create(v)); } values.addAll((Collection<?>)literal); } else if (literal instanceof Object[]) { for (Object v : (Object[])literal) { if (v != null) values.add(type.create(v)); } } else if (literal != null) { values.add(type.create(literal)); } } } return values; }
DynamicOperand lhs = replaceAliasesWithProperties(context, criteria.leftOperand(), propertyByAlias); if (lhs == criteria.leftOperand()) return criteria; return new SetCriteria(lhs, criteria.rightOperands());
protected SetCriteria in( DynamicOperand left, StaticOperand... right ) { return new SetCriteria(left, right); } }
@Override public void visit( SetCriteria criteria ) { criteria.leftOperand().accept(this); append(" IN ("); Iterator<? extends StaticOperand> iter = criteria.rightOperands().iterator(); if (iter.hasNext()) { iter.next().accept(this); while (iter.hasNext()) { append(','); iter.next().accept(this); } } append(')'); }