X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Fmigration%2FOntologiesFromLibrary.java;h=774c6465a3a327e0da60b73c97a9a645291b6554;hb=ccb253462b54a0e036f0906ec8ac11a9021a968c;hp=c715a6401aaa5c52f2329ac4ce808e746d052b72;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/migration/OntologiesFromLibrary.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/migration/OntologiesFromLibrary.java index c715a6401..774c6465a 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/migration/OntologiesFromLibrary.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/migration/OntologiesFromLibrary.java @@ -19,6 +19,7 @@ import org.simantics.db.Resource; import org.simantics.db.common.request.ObjectsWithType; import org.simantics.db.common.request.ResourceRead; import org.simantics.db.exception.DatabaseException; +import org.simantics.db.request.RequestFlags; import org.simantics.layer0.Layer0; public class OntologiesFromLibrary extends ResourceRead> { @@ -32,12 +33,20 @@ public class OntologiesFromLibrary extends ResourceRead> { Layer0 L0 = Layer0.getInstance(graph); ArrayList result = new ArrayList(); for(Resource r : graph.syncRequest(new ObjectsWithType(resource, L0.ConsistsOf, L0.Library))) { - if(graph.isInstanceOf(r, L0.Ontology)) - result.add(r); - else + if(graph.isInstanceOf(r, L0.IndexRoot)) { + if(graph.isInstanceOf(r, L0.Ontology)) { + result.add(r); + } + } else { result.addAll(graph.syncRequest(new OntologiesFromLibrary(r))); + } } return result; } + @Override + public int getType() { + return RequestFlags.IMMEDIATE_UPDATE; + } + }