From: kondelin Date: Mon, 27 Aug 2012 13:53:59 +0000 (+0000) Subject: fixes #3420 X-Git-Tag: v1.31.0~78 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=b5caedf00e900c141600d8564bc5577d9e924b0c;p=simantics%2Finterop.git fixes #3420 git-svn-id: https://www.simantics.org/svn/simantics/interoperability/trunk@25521 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.interop.mapping/src/org/simantics/interop/mapping/SplittingWriteGraph.java b/org.simantics.interop.mapping/src/org/simantics/interop/mapping/SplittingWriteGraph.java index 791ab0a..c3b0298 100644 --- a/org.simantics.interop.mapping/src/org/simantics/interop/mapping/SplittingWriteGraph.java +++ b/org.simantics.interop.mapping/src/org/simantics/interop/mapping/SplittingWriteGraph.java @@ -453,8 +453,51 @@ public class SplittingWriteGraph implements WriteGraph { throw new ServiceException(e); } } - - @Override + + @Override + public Resource newResource(final Resource clusterSet) throws ServiceException { + try { + return session.syncRequest(new WriteResultRequest() { + + @Override + public Resource perform(WriteGraph graph) throws DatabaseException { + return graph.newResource(clusterSet); + } + }); + } catch (DatabaseException e) { + throw new ServiceException(e); + } + } + + @Override + public void newClusterSet(final Resource clusterSet) throws ServiceException { + try { + session.syncRequest(new WriteRequest() { + @Override + public void perform(WriteGraph graph) throws DatabaseException { + graph.newClusterSet(clusterSet); + } + }); + } catch (DatabaseException e) { + throw new ServiceException(e); + } + } + + @Override + public Resource setClusterSet4NewResource(final Resource clusterSet) throws ServiceException { + try { + return session.syncRequest(new WriteResultRequest() { + + @Override + public Resource perform(WriteGraph graph) throws DatabaseException { + return graph.newResource(clusterSet); + } + }); + } catch (DatabaseException e) { + throw new ServiceException(e); + } + } + @Override public T adapt(final Resource resource, final Class clazz) throws AdaptionException, ValidationException, ServiceException { try { diff --git a/org.simantics.interop.mapping/src/org/simantics/interop/mapping/WriteGraphProxy.java b/org.simantics.interop.mapping/src/org/simantics/interop/mapping/WriteGraphProxy.java index 204d801..1fff2a2 100644 --- a/org.simantics.interop.mapping/src/org/simantics/interop/mapping/WriteGraphProxy.java +++ b/org.simantics.interop.mapping/src/org/simantics/interop/mapping/WriteGraphProxy.java @@ -291,8 +291,23 @@ public class WriteGraphProxy implements WriteGraph { public Resource newResource(long clusterId) throws ServiceException { return graph.newResource(clusterId); } - - @Override + + @Override + public Resource newResource(Resource clusterSet) throws ServiceException { + return graph.newResource(clusterSet); + } + + @Override + public void newClusterSet(Resource clusterSet) throws ServiceException { + graph.newClusterSet(clusterSet); + } + + + public Resource setClusterSet4NewResource(Resource clusterSet) throws ServiceException { + return graph.setClusterSet4NewResource(clusterSet); + } + + @Override public T adapt(Resource resource, Class clazz) throws AdaptionException, ValidationException, ServiceException { return graph.adapt(resource, clazz);