--- /dev/null
+package org.simantics.district.network.techtype.requests;
+
+import org.simantics.db.ReadGraph;
+import org.simantics.db.Resource;
+import org.simantics.db.common.request.ResourceRead;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.district.network.ontology.DistrictNetworkResource;
+import org.simantics.layer0.Layer0;
+
+public class PossibleTechTypeKeyName extends ResourceRead<String> {
+ public PossibleTechTypeKeyName(Resource componentType) {
+ super(componentType);
+ }
+
+ @Override
+ public String perform(ReadGraph graph) throws DatabaseException {
+ Layer0 L0 = Layer0.getInstance(graph);
+ DistrictNetworkResource DN = DistrictNetworkResource.getInstance(graph);
+
+ for (Resource r : graph.getObjects(resource, L0.DomainOf)) {
+ Resource accessor = graph.getPossibleObject(r, L0.valueAccessor);
+ if (accessor.equals(DN.TechType_Functions_techTypeCodeValueAccessor)) {
+ return graph.getRelatedValue2(r, L0.HasName);
+ }
+ }
+
+ return null;
+ }
+}