]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.common/src/org/simantics/db/common/transientgraph/StatementBuilder.java
Add logging by default to adapters exception-methods
[simantics/platform.git] / bundles / org.simantics.db.common / src / org / simantics / db / common / transientgraph / StatementBuilder.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.db.common.transientgraph;
13
14 import gnu.trove.list.array.TIntArrayList;
15
16 import org.simantics.db.VirtualGraphContext;
17
18 public class StatementBuilder {
19         
20         TIntArrayList data = new TIntArrayList();
21         
22         public StatementBuilder(int ... stms) {
23                 data.add(stms);
24         }
25
26         public void add(int ... stms) {
27                 data.add(stms);
28         }
29         
30         public void commit(VirtualGraphContext context, int resource) {
31                 context.updateStatements(resource, data.toArray());
32         }
33
34         public static void commit(VirtualGraphContext context, int resource, int ... stms) {
35                 context.updateStatements(resource, stms);
36         }
37         
38 }