--- /dev/null
+package org.simantics.db.common.request;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.exception.DatabaseException;\r
+\r
+public class PossibleNearestOwner extends ResourceRead2<Resource> {\r
+\r
+ public PossibleNearestOwner(Resource resource, Resource type) {\r
+ super(resource, type);\r
+ }\r
+\r
+ @Override\r
+ public Resource perform(ReadGraph graph) throws DatabaseException {\r
+ Resource owner = graph.syncRequest(new PossibleOwner(resource));\r
+ if(owner == null) return null;\r
+ if(graph.isInstanceOf(owner, resource2)) return owner;\r
+ return graph.syncRequest(new PossibleNearestOwner(owner, resource2));\r
+ }\r
+ \r
+}
\ No newline at end of file