public boolean hasRangeCondition() { // NOTE: we need to judge all the conditions, including the nested for (Condition.Relation r : this.relations()) { if (r.relation().isRangeType()) { return true; } } return false; }
public boolean hasSearchCondition() { // NOTE: we need to judge all the conditions, including the nested for (Condition.Relation r : this.relations()) { if (r.relation().isSearchType()) { return true; } } return false; }
private static Condition convTextContainsAny2Or(Relation relation) { assert relation.relation() == Condition.RelationType.TEXT_CONTAINS_ANY; @SuppressWarnings("unchecked") Collection<String> words = (Collection<String>) relation.value(); Condition cond, conds = null; for (String word : words) { assert relation.key() instanceof Id; cond = Condition.textContains((Id) relation.key(), word); conds = conds == null ? cond : Condition.or(conds, cond); } return conds; }
public boolean hasSecondaryCondition() { // NOTE: we need to judge all the conditions, including the nested for (Condition.Relation r : this.relations()) { if (r.relation().isSecondaryType()) { return true; } } return false; }
@Override public boolean isFlattened() { // If this is flattened, its sub-condition should not be nested return this.left().isRelation() && this.right().isRelation(); } }
public IdQuery(Query originQuery, Set<Id> ids) { this(originQuery.resultType(), originQuery); this.query(ids); }
public IdQuery(Query originQuery, Id id) { this(originQuery.resultType(), originQuery); this.query(id); }