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:
10: /**
11: * Manages the rows in the URI table.
12: *
13: * @author James Leigh
14: *
15: */
16: public class URITable {
17: private ValueTable shorter;
18: private ValueTable longer;
19: private int version;
20:
21: public URITable(ValueTable shorter, ValueTable longer) {
22: super ();
23: this .shorter = shorter;
24: this .longer = longer;
25: }
26:
27: public void close() throws SQLException {
28: shorter.close();
29: longer.close();
30: }
31:
32: public int getBatchSize() {
33: return shorter.getBatchSize();
34: }
35:
36: public int getVersion() {
37: return version;
38: }
39:
40: public String getShortTableName() {
41: return shorter.getName();
42: }
43:
44: public String getLongTableName() {
45: return longer.getName();
46: }
47:
48: public void insertShort(Number id, String value)
49: throws SQLException, InterruptedException {
50: shorter.insert(id, value);
51: }
52:
53: public void insertLong(Number id, String value)
54: throws SQLException, InterruptedException {
55: longer.insert(id, value);
56: }
57:
58: public boolean expungeRemovedStatements(int count, String condition)
59: throws SQLException {
60: boolean bool = false;
61: bool |= shorter.expungeRemovedStatements(count, condition);
62: bool |= longer.expungeRemovedStatements(count, condition);
63: return bool;
64: }
65:
66: @Override
67: public String toString() {
68: return shorter.getName() + " UNION ALL " + longer.getName();
69: }
70:
71: public void optimize() throws SQLException {
72: shorter.optimize();
73: longer.optimize();
74: }
75: }
|