01: /*
02: * Copyright 2002 (C) TJDO.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the TJDO License version 1.0.
06: * See the terms of the TJDO License in the documentation provided with this software.
07: *
08: * $Id: Table.java,v 1.3 2003/04/28 00:52:17 jackknifebarber Exp $
09: */
10:
11: package com.triactive.jdo.store;
12:
13: import java.sql.Connection;
14: import java.sql.SQLException;
15:
16: interface Table {
17: /** Returned by StoreManager.getTableType() if the table does not exist. */
18: static final int TABLE_TYPE_MISSING = -1;
19:
20: /**
21: * Returned by StoreManager.getTableType() if the table type is not
22: * recognized.
23: */
24: static final int TABLE_TYPE_UNKNOWN = 0;
25:
26: /** Returned by StoreManager.getTableType() if the table is a base table. */
27: static final int TABLE_TYPE_BASE_TABLE = 1;
28:
29: /** Returned by StoreManager.getTableType() if the table is a view. */
30: static final int TABLE_TYPE_VIEW = 2;
31:
32: /**
33: * Bit flag passed to validate() to indicate that the table structure should
34: * be validated using JDBC metadata.
35: */
36: static final int VALIDATE = 1;
37:
38: /**
39: * Bit flag passed to validate() to indicate that the table should be
40: * created if it is missing.
41: */
42: static final int AUTO_CREATE = 2;
43:
44: void initialize();
45:
46: boolean isInitialized();
47:
48: SQLIdentifier getName();
49:
50: StoreManager getStoreManager();
51:
52: String getSchemaName();
53:
54: void addColumn(Column col);
55:
56: Column newColumn(Class type, String javaName);
57:
58: Column newColumn(Class type, SQLIdentifier name, Role role);
59:
60: boolean exists(Connection conn) throws SQLException;
61:
62: void create(Connection conn) throws SQLException;
63:
64: boolean validate(int flags, Connection conn) throws SQLException;
65:
66: boolean isValidated();
67:
68: void drop(Connection conn) throws SQLException;
69: }
|