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%2Fmigration%2FOntologiesFromLibrary.java;h=774c6465a3a327e0da60b73c97a9a645291b6554;hp=c715a6401aaa5c52f2329ac4ce808e746d052b72;hb=ab914ca281bc4cfb6f8b7a9a38956c71fbd66839;hpb=7a90a6a6acc2fbc1cf2a5238b1c6ce719ce53f6d 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; + } + }