package org.simantics.db.layer0.genericrelation;
+import java.util.Set;
+
import org.simantics.databoard.Bindings;
import org.simantics.datatypes.literal.GUID;
import org.simantics.db.ReadGraph;
this.parent = graph.getPossibleObject(resource, L0.PartOf);
this.resource = resource;
this.name = graph.getPossibleRelatedValue(resource, L0.HasName, Bindings.STRING);
- this.types = graph.syncRequest(new TypeString(L0, graph.getTypes(resource)));
- this.id = idFromGUID(graph.getPossibleRelatedValue(resource, L0.identifier, GUID.BINDING));
- }
-
- private static String idFromGUID(GUID guid) {
- if(guid == null) return "";
- return guid.indexString();
+ Set<Resource> typeSet = graph.getTypes(resource);
+ this.types = graph.syncRequest(new TypeString(L0, typeSet));
+ this.id = IndexQueries.idFromGUID(graph.getPossibleRelatedValue(resource, L0.identifier, GUID.BINDING));
+ this.typeId = IndexQueries.toResourceIdString(typeSet);
}
Entry(ReadGraph graph, Resource resource) throws DatabaseException {
String types;
String name;
String id;
+ String typeId;
Resource principalType;
@Override