X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Fgenericrelation%2FEntry.java;fp=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Fgenericrelation%2FEntry.java;h=50d723ec9b1ae7d77a8c54ce4358cdafd89e8bb6;hp=8da8209499665c4f4ff9c60d0889d9a39d9a46ef;hb=ad0e5bf4b34705988e23c9ee3f8e4fcbb760c701;hpb=0f2d6b33db9eabe0c1b142f6d0197a5d1446c3b1 diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/genericrelation/Entry.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/genericrelation/Entry.java index 8da820949..50d723ec9 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/genericrelation/Entry.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/genericrelation/Entry.java @@ -1,5 +1,7 @@ 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; @@ -22,13 +24,10 @@ class Entry implements Comparable { 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 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 { @@ -41,6 +40,7 @@ class Entry implements Comparable { String types; String name; String id; + String typeId; Resource principalType; @Override