use of com.runwaysdk.dataaccess.graph.VertexObjectDAOIF in project geoprism-registry by terraframe.
the class SearchService method insert.
// @Transaction
public void insert(VertexServerGeoObject object) {
this.remove(object.getCode());
String suffix = this.getSuffix();
MdVertexDAOIF mdVertex = MdVertexDAO.getMdVertexDAO(PACKAGE + "." + VERTEX_PREFIX + suffix);
MdEdgeDAOIF mdEdge = MdEdgeDAO.getMdEdgeDAO(PACKAGE + "." + EDGE_PREFIX + suffix);
ValueOverTimeCollection vots = object.getValuesOverTime(DefaultAttribute.DISPLAY_LABEL.getName());
for (ValueOverTime vot : vots) {
VertexObjectDAOIF value = (VertexObjectDAOIF) vot.getValue();
Set<String> attributeNames = LocalizationService.getLocaleNames();
for (String attributeName : attributeNames) {
String label = value.getObjectValue(attributeName);
if (label != null && label.length() > 0) {
VertexObject vertex = new VertexObject(mdVertex.definesType());
vertex.setValue(START_DATE, vot.getStartDate());
vertex.setValue(END_DATE, vot.getEndDate());
vertex.setValue(CODE, object.getCode());
vertex.setValue(LABEL, label);
vertex.setValue(VERTEX_TYPE, object.getType().getCode());
vertex.apply();
vertex.addChild(object.getVertex(), mdEdge).apply();
}
}
}
}
Aggregations