]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/StatementHandleImpl.java
Merge "Save cluster sets only when creating DB snapshots"
[simantics/platform.git] / bundles / org.simantics.db.procore / src / fi / vtt / simantics / procore / internal / StatementHandleImpl.java
1 package fi.vtt.simantics.procore.internal;
2
3 import org.simantics.db.procore.cluster.ClusterImpl;
4 import org.simantics.db.service.ClusterUID;
5 import org.simantics.db.service.ClusterBuilder.StatementHandle;
6
7 final public class StatementHandleImpl implements StatementHandle {
8
9     final int pKey;
10     final int oKey;
11     final byte pForeign;
12     final byte oForeign;
13     final ClusterUID pClusterUID;
14     final ClusterUID oClusterUID;
15
16     public StatementHandleImpl(int pKey, byte pForeign, int oKey, byte oForeign,
17             ClusterUID pClusterUID, ClusterUID oClusterUID)  {
18         this.pKey = pKey;
19         this.oKey = oKey;
20         this.pForeign = pForeign;
21         this.oForeign = oForeign;
22         this.pClusterUID = pClusterUID;
23         this.oClusterUID = oClusterUID;
24     }
25     
26     public void apply(Object cluster) {
27
28         ClusterImpl impl = (ClusterImpl)cluster;
29         Change change = impl.change;
30
31         change.addStatementIndex1(pKey, pClusterUID, pForeign, impl.foreignLookup);
32         change.addStatementIndex2(oKey, oClusterUID, oForeign, impl.foreignLookup);
33         
34     }
35     
36 }