use of com.baidu.hugegraph.entity.schema.ConflictStatus in project incubator-hugegraph-toolchain by apache.
the class PropertyKeyService method checkConflict.
public void checkConflict(List<PropertyKeyEntity> entities, ConflictDetail detail, int connId, boolean compareEachOther) {
if (CollectionUtils.isEmpty(entities)) {
return;
}
Map<String, PropertyKeyEntity> originEntities = new HashMap<>();
for (PropertyKeyEntity entity : this.list(connId)) {
originEntities.put(entity.getName(), entity);
}
// Compare reused entity with origin in target graph
for (PropertyKeyEntity entity : entities) {
PropertyKeyEntity originEntity = originEntities.get(entity.getName());
ConflictStatus status = SchemaEntity.compare(entity, originEntity);
detail.add(entity, status);
}
// Compare resued entities with each other
if (compareEachOther) {
compareWithEachOther(detail, SchemaType.PROPERTY_KEY);
}
}
Aggregations