/** * Creates a new property key with default settings against the provided {@link PropertyKeyMaker}. * * @param factory PropertyKeyMaker through which the property key is created * @return A new property key * @throws IllegalArgumentException if the name is already in use or if other configured values are invalid. */ public default PropertyKey makePropertyKey(PropertyKeyMaker factory) { return factory.cardinality(defaultPropertyCardinality(factory.getName())).dataType(Object.class).make(); }
@Override public VertexProperty.Cardinality getCardinality(final String key) { StandardTitanTx tx = (StandardTitanTx)TitanFeatures.this.graph.newTransaction(); try { if (!tx.containsPropertyKey(key)) return tx.getConfiguration().getAutoSchemaMaker().defaultPropertyCardinality(key).convert(); return tx.getPropertyKey(key).cardinality().convert(); } finally { tx.rollback(); } }
/** * Creates a new property key with default settings against the provided {@link PropertyKeyMaker}. * * @param factory PropertyKeyMaker through which the property key is created * @return A new property key * @throws IllegalArgumentException if the name is already in use or if other configured values are invalid. */ public default PropertyKey makePropertyKey(PropertyKeyMaker factory) { return factory.cardinality(defaultPropertyCardinality(factory.getName())).dataType(Object.class).make(); }
@Override public VertexProperty.Cardinality getCardinality(final String key) { StandardTitanTx tx = (StandardTitanTx)TitanFeatures.this.graph.newTransaction(); try { if (!tx.containsPropertyKey(key)) return tx.getConfiguration().getAutoSchemaMaker().defaultPropertyCardinality(key).convert(); return tx.getPropertyKey(key).cardinality().convert(); } finally { tx.rollback(); } }