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