public List<Relation> userpropRelations() { List<Relation> relations = new ArrayList<>(); for (Relation r : this.relations()) { if (!r.isSysprop()) { relations.add(r); } } return relations; }
public Set<Id> userpropKeys() { Set<Id> keys = new LinkedHashSet<>(); for (Relation r : this.relations()) { if (!r.isSysprop()) { Condition.UserpropRelation ur = (Condition.UserpropRelation) r; keys.add(ur.key()); } } return keys; }
/** * This method is only used for secondary index scenario, * its relation must be EQ * @param fields the user property fields * @return the corresponding user property serial values of fields */ public String userpropValuesString(List<Id> fields) { List<Object> values = new ArrayList<>(fields.size()); for (Id field : fields) { boolean got = false; for (Relation r : this.userpropRelations()) { if (r.key().equals(field) && !r.isSysprop()) { E.checkState(r.relation == RelationType.EQ, "Method userpropValues(List<String>) only " + "used for secondary index, " + "relation must be EQ, but got %s", r.relation()); values.add(r.serialValue()); got = true; } } if (!got) { throw new BackendException( "No such userprop named '%s' in the query '%s'", field, this); } } return SplicingIdGenerator.concatValues(values); }
/** * This method is only used for secondary index scenario, * relation must be EQ * @param fields the user property fields * @return the corresponding user property values of fileds */ public List<Object> userpropValues(List<Id> fields) { List<Object> values = new ArrayList<>(fields.size()); for (Id field : fields) { boolean got = false; for (Relation r : this.userpropRelations()) { if (r.key().equals(field) && !r.isSysprop()) { E.checkState(r.relation == RelationType.EQ, "Method userpropValues(List<String>) only " + "used for secondary index, " + "relation must be EQ, but got '%s'", r.relation()); values.add(r.value()); got = true; } } if (!got) { throw new BackendException( "No such userprop named '%s' in the query '%s'", field, this); } } return values; }
public Set<Id> userpropKeys() { Set<Id> keys = new LinkedHashSet<>(); for (Relation r : this.relations()) { if (!r.isSysprop()) { Condition.UserpropRelation ur = (Condition.UserpropRelation) r; keys.add(ur.key()); } } return keys; }
public List<Relation> userpropRelations() { List<Relation> relations = new ArrayList<>(); for (Relation r : this.relations()) { if (!r.isSysprop()) { relations.add(r); } } return relations; }