]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/migration/OntologiesFromLibrary.java
Sync git svn branch with SVN repository r33303.
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / migration / OntologiesFromLibrary.java
index a742b1e48639d4ad8b6cf90dfd3ac351b2e60fa8..1b88cbb656f09a48278fce200a30deed750ffd55 100644 (file)
@@ -17,23 +17,21 @@ import java.util.List;
 import org.simantics.db.ReadGraph;\r
 import org.simantics.db.Resource;\r
 import org.simantics.db.common.request.ObjectsWithType;\r
+import org.simantics.db.common.request.ResourceRead;\r
 import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.request.Read;\r
 import org.simantics.layer0.Layer0;\r
 \r
-public class OntologiesFromLibrary implements Read<List<Resource>> {\r
-    \r
-    Resource library;\r
+public class OntologiesFromLibrary extends ResourceRead<List<Resource>> {\r
     \r
     public OntologiesFromLibrary(Resource library) {\r
-        this.library = library;\r
+       super(library);\r
     }\r
 \r
     @Override\r
     public List<Resource> perform(ReadGraph graph) throws DatabaseException {\r
         Layer0 L0 = Layer0.getInstance(graph);\r
         ArrayList<Resource> result = new ArrayList<Resource>();\r
-        for(Resource r : graph.syncRequest(new ObjectsWithType(library, L0.ConsistsOf, L0.Library))) {\r
+        for(Resource r : graph.syncRequest(new ObjectsWithType(resource, L0.ConsistsOf, L0.Library))) {\r
             if(graph.isInstanceOf(r, L0.Ontology))\r
                 result.add(r);\r
             else\r