use of com.baidu.hugegraph.type.define.DataType in project incubator-hugegraph by apache.
the class TextSerializer method readPropertyKey.
@Override
public PropertyKey readPropertyKey(HugeGraph graph, BackendEntry backendEntry) {
if (backendEntry == null) {
return null;
}
TextBackendEntry entry = this.convertEntry(backendEntry);
Id id = readId(entry.id());
String name = JsonUtil.fromJson(entry.column(HugeKeys.NAME), String.class);
String dataType = entry.column(HugeKeys.DATA_TYPE);
String cardinality = entry.column(HugeKeys.CARDINALITY);
String aggregateType = entry.column(HugeKeys.AGGREGATE_TYPE);
String writeType = entry.column(HugeKeys.WRITE_TYPE);
String properties = entry.column(HugeKeys.PROPERTIES);
String status = entry.column(HugeKeys.STATUS);
PropertyKey propertyKey = new PropertyKey(graph, id, name);
propertyKey.dataType(JsonUtil.fromJson(dataType, DataType.class));
propertyKey.cardinality(JsonUtil.fromJson(cardinality, Cardinality.class));
propertyKey.aggregateType(JsonUtil.fromJson(aggregateType, AggregateType.class));
propertyKey.writeType(JsonUtil.fromJson(writeType, WriteType.class));
propertyKey.properties(readIds(properties));
readUserdata(propertyKey, entry);
propertyKey.status(JsonUtil.fromJson(status, SchemaStatus.class));
return propertyKey;
}
use of com.baidu.hugegraph.type.define.DataType in project incubator-hugegraph by apache.
the class IndexLabelBuilder method allStringIndex.
private boolean allStringIndex(List<?> fields) {
for (Object field : fields) {
PropertyKey pk = field instanceof Id ? this.graph().propertyKey((Id) field) : this.graph().propertyKey((String) field);
DataType dataType = pk.dataType();
if (dataType.isNumber() || dataType.isDate()) {
return false;
}
}
return true;
}
Aggregations