1 package org.simantics.district.network.techtype.requests;
5 import org.simantics.db.ReadGraph;
6 import org.simantics.db.Resource;
7 import org.simantics.db.common.procedure.adapter.TransientCacheListener;
8 import org.simantics.db.common.request.BinaryRead;
9 import org.simantics.db.exception.DatabaseException;
12 * Query for a possible tech type table item in a table with a given item key.
14 * Results in null, if no such item was found.
16 public class PossibleTechTypeItem extends BinaryRead<Resource, String, Map<String, String>> {
18 public PossibleTechTypeItem(Resource table, String itemCode) {
19 super(table, itemCode);
23 public Map<String, String> perform(ReadGraph graph) throws DatabaseException {
24 Resource table = this.parameter;
25 String itemCode = this.parameter2;
27 Map<String, Map<String, String>> map = graph.syncRequest(new TechTypeTableData(table), TransientCacheListener.instance());
28 return map.get(itemCode);