- Map<String, Long> result = Simantics.getSession().syncRequest(new UniqueRead<Map<String, Long>>() {\r
-\r
- @Override\r
- public Map<String, Long> perform(ReadGraph graph) throws DatabaseException {\r
- Map<String, Long> map = new HashMap<>();\r
- for (Map.Entry<Object, Object> entry : props.entrySet()) {\r
- String value = (String) entry.getValue();\r
- Long id = Long.valueOf(value);\r
- SerialisationSupport ss = graph.getService(SerialisationSupport.class);\r
- try {\r
- Resource r = ss.getResource(id);\r
- String name = graph.getRelatedValue(r, Layer0.getInstance(graph).HasName);\r
- map.put(name, id);\r
- } catch (DatabaseException e) {\r
- e.printStackTrace();\r
- }\r
- }\r
- return map;\r
- }\r
- });\r
-\r
- return result;\r
- } catch (IOException | DatabaseException e) {\r
+ Map<String, String> map = new HashMap<>();\r
+ for (Map.Entry<Object, Object> entry : props.entrySet()) {\r
+ String value = (String) entry.getValue();\r
+ String key = (String) entry.getKey();\r
+ map.put(key, value);\r
+ }\r
+ return map;\r
+ } catch (IOException e) {\r