X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Futil%2FModelTransferableGraphSource.java;h=1d3cf61f54c6c6ad296b06a959f62dac66601537;hb=refs%2Fchanges%2F17%2F717%2F3;hp=2d0fbcfe18282dc733a8e6be4596a5c344be2bca;hpb=628bd7cc1c131484dc13f162731d84812988bd70;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/ModelTransferableGraphSource.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/ModelTransferableGraphSource.java index 2d0fbcfe1..1d3cf61f5 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/ModelTransferableGraphSource.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/ModelTransferableGraphSource.java @@ -396,10 +396,13 @@ public class ModelTransferableGraphSource implements TransferableGraphSource { // Declare internal and external roots for(RootSpec r : configuration.roots) { - Resource type = graph.getPossibleType(r.resource, L0.Entity); - if(type == null) type = L0.Entity; + String typeId = r.type; + if (typeId == null) { + Resource type = graph.getPossibleType(r.resource, L0.Entity); + typeId = type != null ? graph.getURI(type) : Layer0.URIs.Entity; + } int id = state.ids.get(support.getTransientId(r.resource)); - Root root = new Root(r.name, graph.getURI(type)); + Root root = new Root(r.name, typeId); Identity rootId = new Identity(id,root); internalMap.put(id, rootId); procedure.execute(rootId); @@ -413,8 +416,12 @@ public class ModelTransferableGraphSource implements TransferableGraphSource { if(state.internalEntries != null) { for(InternalEntry ie : state.internalEntries) { - if(ie.parent != null && ie.name != null) { - procedure.execute(resolveInternal(graph, support, ie, internalMap)); + if(ie.parent != null) { + if(ie.name != null) { + procedure.execute(resolveInternal(graph, support, ie, internalMap)); + } else { + // In this case there is a child that has no HasName => this should be treated as a blank + } } else { throw new DatabaseException("Invalid internal entry " + ie); }