@Override public Q orderBy(String keyName, org.apache.tinkerpop.gremlin.process.traversal.Order order) { Preconditions.checkArgument(schemaInspector.containsPropertyKey(keyName), "Provided key does not exist: %s", keyName); PropertyKey key = schemaInspector.getPropertyKey(keyName); Preconditions.checkArgument(key != null && order != null, "Need to specify and key and an order"); Preconditions.checkArgument(Comparable.class.isAssignableFrom(key.dataType()), "Can only order on keys with comparable data type. [%s] has datatype [%s]", key.name(), key.dataType()); Preconditions.checkArgument(key.cardinality() == Cardinality.SINGLE, "Ordering is undefined on multi-valued key [%s]", key.name()); Preconditions.checkArgument(!(key instanceof SystemRelationType), "Cannot use system types in ordering: %s", key); Preconditions.checkArgument(!orders.containsKey(key)); Preconditions.checkArgument(orders.isEmpty(), "Only a single sort order is supported on vertex queries"); orders.add(key, Order.convert(order)); return getThis(); }
protected final boolean hasSingleType() { return types.length == 1 && schemaInspector.getRelationType(types[0]) != null; }
@Override public Q orderBy(String key, Order order) { Preconditions.checkArgument(schemaInspector.containsPropertyKey(key),"Provided key does not exist: %s",key); return orderBy(schemaInspector.getPropertyKey(key), order); }
/** * Whether this query is asking for the value of an {@link com.thinkaurelius.titan.graphdb.types.system.ImplicitKey}. * </p> * Handling of implicit keys is completely distinct from "normal" query execution and handled extra * for completeness reasons. * * @param returnType * @return */ protected final boolean isImplicitKeyQuery(RelationCategory returnType) { if (returnType == RelationCategory.EDGE || types.length != 1 || !constraints.isEmpty()) return false; return schemaInspector.getRelationType(types[0]) instanceof ImplicitKey; }
@Override public Q orderBy(String keyName, org.apache.tinkerpop.gremlin.process.traversal.Order order) { Preconditions.checkArgument(schemaInspector.containsPropertyKey(keyName), "Provided key does not exist: %s", keyName); PropertyKey key = schemaInspector.getPropertyKey(keyName); Preconditions.checkArgument(key != null && order != null, "Need to specify and key and an order"); Preconditions.checkArgument(Comparable.class.isAssignableFrom(key.dataType()), "Can only order on keys with comparable data type. [%s] has datatype [%s]", key.name(), key.dataType()); Preconditions.checkArgument(key.cardinality() == Cardinality.SINGLE, "Ordering is undefined on multi-valued key [%s]", key.name()); Preconditions.checkArgument(!(key instanceof SystemRelationType), "Cannot use system types in ordering: %s", key); Preconditions.checkArgument(!orders.containsKey(key)); Preconditions.checkArgument(orders.isEmpty(), "Only a single sort order is supported on vertex queries"); orders.add(key, Order.convert(order)); return getThis(); }
protected final RelationType getSingleType() { Preconditions.checkArgument(hasSingleType()); return schemaInspector.getRelationType(types[0]); }
protected final boolean hasSingleType() { return types.length == 1 && schemaInspector.getRelationType(types[0]) != null; }
protected final boolean hasSingleType() { return types.length==1 && schemaInspector.getRelationType(types[0])!=null; }
/** * Whether this query is asking for the value of an {@link com.thinkaurelius.titan.graphdb.types.system.ImplicitKey}. * </p> * Handling of implicit keys is completely distinct from "normal" query execution and handled extra * for completeness reasons. * * @param returnType * @return */ protected final boolean isImplicitKeyQuery(RelationCategory returnType) { if (returnType == RelationCategory.EDGE || types.length != 1 || !constraints.isEmpty()) return false; return schemaInspector.getRelationType(types[0]) instanceof ImplicitKey; }
/** * Whether this query is asking for the value of an {@link com.thinkaurelius.titan.graphdb.types.system.ImplicitKey}. * </p> * Handling of implicit keys is completely distinct from "normal" query execution and handled extra * for completeness reasons. * * @param returnType * @return */ protected final boolean isImplicitKeyQuery(RelationCategory returnType) { if (returnType==RelationCategory.EDGE || types.length!=1 || !constraints.isEmpty()) return false; return schemaInspector.getRelationType(types[0]) instanceof ImplicitKey; }
protected final RelationType getSingleType() { Preconditions.checkArgument(hasSingleType()); return schemaInspector.getRelationType(types[0]); }
protected final RelationType getSingleType() { Preconditions.checkArgument(hasSingleType()); return schemaInspector.getRelationType(types[0]); }