1 package org.simantics.db.common.request;
\r
3 import org.simantics.db.ReadGraph;
\r
4 import org.simantics.db.Resource;
\r
5 import org.simantics.db.exception.DatabaseException;
\r
7 public class PossibleNearestOwner extends ResourceRead2<Resource> {
\r
9 public PossibleNearestOwner(Resource resource, Resource type) {
\r
10 super(resource, type);
\r
14 public Resource perform(ReadGraph graph) throws DatabaseException {
\r
15 Resource owner = graph.syncRequest(new PossibleOwner(resource));
\r
16 if(owner == null) return null;
\r
17 if(graph.isInstanceOf(owner, resource2)) return owner;
\r
18 return graph.syncRequest(new PossibleNearestOwner(owner, resource2));
\r