private static ConditionQuery newQueryFromRelations(ConditionQuery query, Relations relations) { ConditionQuery cq = query.copy(); cq.resetConditions(); for (Relation relation : relations) { cq.query(relation); } return cq; }
public Query query(CassandraSessionPool.Session session, Query query) { Set<Condition> conditions = query.conditions(); if (!(query instanceof ConditionQuery) || conditions.isEmpty()) { return query; } ConditionQuery q = ((ConditionQuery) query).copy(); String name = (String) q.condition(HugeKeys.NAME); if (name != null && q.allSysprop() && conditions.size() == 1 && q.containsCondition(HugeKeys.NAME, Condition.RelationType.EQ)) { Set<Integer> ids = queryByNameIndex(session, this.table, name); if (ids.isEmpty()) { // Not found data with the specified label return null; } q.resetConditions(); for (Integer id : ids) { q.query(IdGenerator.of(id)); } } return q; }
private static IndexQueries constructQueries(ConditionQuery query, Set<IndexLabel> ils, Set<Id> propKeys) { IndexQueries queries = new IndexQueries(); for (IndexLabel il : ils) { List<Id> fields = il.indexFields(); ConditionQuery newQuery = query.copy(); newQuery.resetUserpropConditions(); for (Id field : fields) { if (!propKeys.contains(field)) { break; } for (Condition c : query.userpropConditions(field)) { newQuery.query(c); } } ConditionQuery q = matchIndexLabel(newQuery, il); assert q != null; queries.put(il, q); } return queries; }
query = query.copy(); for (Id field : queryPropKeys) { query.unsetCondition(field);
indexFields.add(indexField); query = query.copy(); query.unsetCondition(indexField); query.query(Condition.textContainsAny(indexField, words));
query = query.copy();
private static ConditionQuery newQueryFromRelations(ConditionQuery query, Relations relations) { ConditionQuery cq = query.copy(); cq.resetConditions(); for (Relation relation : relations) { cq.query(relation); } return cq; }
public Query query(CassandraSessionPool.Session session, Query query) { Set<Condition> conditions = query.conditions(); if (!(query instanceof ConditionQuery) || conditions.isEmpty()) { return query; } ConditionQuery q = ((ConditionQuery) query).copy(); String name = (String) q.condition(HugeKeys.NAME); if (name != null && q.allSysprop() && conditions.size() == 1 && q.containsCondition(HugeKeys.NAME, Condition.RelationType.EQ)) { Set<Integer> ids = queryByNameIndex(session, this.table, name); if (ids.isEmpty()) { // Not found data with the specified label return null; } q.resetConditions(); for (Integer id : ids) { q.query(IdGenerator.of(id)); } } return q; }
private static IndexQueries constructQueries(ConditionQuery query, Set<IndexLabel> ils, Set<Id> propKeys) { IndexQueries queries = new IndexQueries(); for (IndexLabel il : ils) { List<Id> fields = il.indexFields(); ConditionQuery newQuery = query.copy(); newQuery.resetUserpropConditions(); for (Id field : fields) { if (!propKeys.contains(field)) { break; } for (Condition c : query.userpropConditions(field)) { newQuery.query(c); } } ConditionQuery q = matchIndexLabel(newQuery, il); assert q != null; queries.put(il, q); } return queries; }
query = query.copy(); for (Id field : queryPropKeys) { query.unsetCondition(field);
indexFields.add(indexField); query = query.copy(); query.unsetCondition(indexField); query.query(Condition.textContainsAny(indexField, words));
query = query.copy(); query.eq(HugeKeys.SORT_VALUES, query.userpropValuesString(keys));
query = query.copy(); query.resetConditions();