01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 2008.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.sail.rdbms.schema;
07:
08: import java.sql.SQLException;
09: import java.util.ArrayList;
10: import java.util.List;
11:
12: /**
13: *
14: * @author James Leigh
15: */
16: public class HashBatch extends ValueBatch {
17: private List<Long> hashes;
18:
19: @Override
20: public void setMaxBatchSize(int batchSize) {
21: super .setMaxBatchSize(batchSize);
22: hashes = new ArrayList<Long>(batchSize);
23: }
24:
25: public List<Long> getHashes() {
26: return hashes;
27: }
28:
29: public void addBatch(Number id, long hash) throws SQLException {
30: hashes.add(hash);
31: setObject(1, id);
32: setObject(2, hash);
33: addBatch();
34: }
35:
36: }
|