]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/StatementHandleImpl.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db.procore / src / fi / vtt / simantics / procore / internal / StatementHandleImpl.java
diff --git a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/StatementHandleImpl.java b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/StatementHandleImpl.java
new file mode 100644 (file)
index 0000000..1630b12
--- /dev/null
@@ -0,0 +1,36 @@
+package fi.vtt.simantics.procore.internal;\r
+\r
+import org.simantics.db.procore.cluster.ClusterImpl;\r
+import org.simantics.db.service.ClusterUID;\r
+import org.simantics.db.service.ClusterBuilder.StatementHandle;\r
+\r
+final public class StatementHandleImpl implements StatementHandle {\r
+\r
+    final int pKey;\r
+    final int oKey;\r
+    final byte pForeign;\r
+    final byte oForeign;\r
+    final ClusterUID pClusterUID;\r
+    final ClusterUID oClusterUID;\r
+\r
+    public StatementHandleImpl(int pKey, byte pForeign, int oKey, byte oForeign,\r
+            ClusterUID pClusterUID, ClusterUID oClusterUID)  {\r
+        this.pKey = pKey;\r
+        this.oKey = oKey;\r
+        this.pForeign = pForeign;\r
+        this.oForeign = oForeign;\r
+        this.pClusterUID = pClusterUID;\r
+        this.oClusterUID = oClusterUID;\r
+    }\r
+    \r
+    public void apply(Object cluster) {\r
+\r
+        ClusterImpl impl = (ClusterImpl)cluster;\r
+        Change change = impl.change;\r
+\r
+        change.addStatementIndex1(pKey, pClusterUID, pForeign, impl.foreignLookup);\r
+        change.addStatementIndex2(oKey, oClusterUID, oForeign, impl.foreignLookup);\r
+        \r
+    }\r
+    \r
+}\r