]> gerrit.simantics Code Review - simantics/interop.git/blobdiff - org.simantics.interop.mapping/src/org/simantics/interop/mapping/SplittingWriteGraph.java
Fixed SplittingWriteGraph/WriteGraphProxy to work with WriteGraph/ReadGraph API addit...
[simantics/interop.git] / org.simantics.interop.mapping / src / org / simantics / interop / mapping / SplittingWriteGraph.java
index f8e5faea31b86deb45b17fd883067377ef52c3dc..a91c8c0b72eff08f3ecf195887967c716a04c870 100644 (file)
@@ -371,14 +371,20 @@ public class SplittingWriteGraph implements WriteGraph {
                });\r
        }\r
 \r
-    @Override\r
-    public RandomAccessBinary newLiteral4RandomAccessBinary\r
-    (final Resource resource, final Resource predicate, final Datatype datatype, final Object initialvalue)\r
-    throws DatabaseException {\r
+       public RandomAccessBinary createRandomAccessBinary(final Resource resource, final Resource predicate, final Datatype datatype, final Object initialValue) throws DatabaseException {\r
+        return session.syncRequest(new WriteResultRequest<RandomAccessBinary>() {\r
+            @Override\r
+            public RandomAccessBinary perform(WriteGraph graph) throws DatabaseException {\r
+                return graph.createRandomAccessBinary(resource, predicate, datatype, initialValue);\r
+            }\r
+        });\r
+    }\r
+\r
+    public RandomAccessBinary createRandomAccessBinary(final Resource resource, final Datatype datatype, final Object initialValue) throws DatabaseException {\r
         return session.syncRequest(new WriteResultRequest<RandomAccessBinary>() {\r
             @Override\r
             public RandomAccessBinary perform(WriteGraph graph) throws DatabaseException {\r
-                return graph.newLiteral4RandomAccessBinary(resource, predicate, datatype, initialvalue);\r
+                return graph.createRandomAccessBinary(resource, datatype, initialValue);\r
             }\r
         });\r
     }\r
@@ -2439,7 +2445,7 @@ public class SplittingWriteGraph implements WriteGraph {
                                \r
                                @Override\r
                                public Set<Resource> perform(ReadGraph graph) throws DatabaseException {\r
-               return graph.getSupertypes(subject);\r
+                                       return graph.getSupertypes(subject);\r
                                }\r
                        });\r
                } catch (DatabaseException e) {\r
@@ -2455,7 +2461,20 @@ public class SplittingWriteGraph implements WriteGraph {
                                \r
                                @Override\r
                                public Set<Resource> perform(ReadGraph graph) throws DatabaseException {\r
-               return graph.getSuperrelations(subject);\r
+                                       return graph.getSuperrelations(subject);\r
+                               }\r
+                       });\r
+               } catch (DatabaseException e) {\r
+                       throw new ServiceException(e);\r
+               }\r
+       }\r
+\r
+       public Resource getPossibleSuperrelation(final Resource subject) throws ServiceException {\r
+               try {\r
+                       return session.syncRequest(new Read<Resource>() {\r
+                               @Override\r
+                               public Resource perform(ReadGraph graph) throws DatabaseException {\r
+                                       return graph.getPossibleSuperrelation(subject);\r
                                }\r
                        });\r
                } catch (DatabaseException e) {\r