]> gerrit.simantics Code Review - simantics/district.git/blob
b47bbc70c65f1a731ba1efb88b8c568b99e9c90a
[simantics/district.git] /
1 package org.simantics.district.network.ui.techtype.requests;
2
3 import org.simantics.databoard.Bindings;
4 import org.simantics.db.ReadGraph;
5 import org.simantics.db.Resource;
6 import org.simantics.db.common.procedure.adapter.TransientCacheListener;
7 import org.simantics.db.common.request.ResourceRead2;
8 import org.simantics.db.exception.DatabaseException;
9 import org.simantics.district.network.ontology.DistrictNetworkResource;
10
11 public class PossibleTechTypeTableData extends ResourceRead2<String> {
12         public PossibleTechTypeTableData(Resource model, Resource componentType) {
13                 super(model, componentType);
14         }
15
16         @Override
17         public String perform(ReadGraph graph) throws DatabaseException {
18                 DistrictNetworkResource DN = DistrictNetworkResource.getInstance(graph);
19
20                 Resource ttt = graph.syncRequest(new PossibleTechTypeTable(resource, resource2), TransientCacheListener.instance());
21                 return ttt != null ? graph.getPossibleRelatedValue2(ttt, DN.TechType_TechTypeTable_HasData, Bindings.STRING) : null;
22         }
23 }