KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > triactive > jdo > store > Table


1 /*
2  * Copyright 2002 (C) TJDO.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the TJDO License version 1.0.
6  * See the terms of the TJDO License in the documentation provided with this software.
7  *
8  * $Id: Table.java,v 1.3 2003/04/28 00:52:17 jackknifebarber Exp $
9  */

10
11 package com.triactive.jdo.store;
12
13 import java.sql.Connection JavaDoc;
14 import java.sql.SQLException JavaDoc;
15
16
17 interface Table
18 {
19     /** Returned by StoreManager.getTableType() if the table does not exist. */
20     static final int TABLE_TYPE_MISSING = -1;
21
22     /**
23      * Returned by StoreManager.getTableType() if the table type is not
24      * recognized.
25      */

26     static final int TABLE_TYPE_UNKNOWN = 0;
27
28     /** Returned by StoreManager.getTableType() if the table is a base table. */
29     static final int TABLE_TYPE_BASE_TABLE = 1;
30
31     /** Returned by StoreManager.getTableType() if the table is a view. */
32     static final int TABLE_TYPE_VIEW = 2;
33
34     /**
35      * Bit flag passed to validate() to indicate that the table structure should
36      * be validated using JDBC metadata.
37      */

38     static final int VALIDATE = 1;
39
40     /**
41      * Bit flag passed to validate() to indicate that the table should be
42      * created if it is missing.
43      */

44     static final int AUTO_CREATE = 2;
45
46
47     void initialize();
48
49     boolean isInitialized();
50
51     SQLIdentifier getName();
52
53     StoreManager getStoreManager();
54
55     String JavaDoc getSchemaName();
56
57     void addColumn(Column col);
58
59     Column newColumn(Class JavaDoc type, String JavaDoc javaName);
60
61     Column newColumn(Class JavaDoc type, SQLIdentifier name, Role role);
62
63     boolean exists(Connection JavaDoc conn) throws SQLException JavaDoc;
64
65     void create(Connection JavaDoc conn) throws SQLException JavaDoc;
66
67     boolean validate(int flags, Connection JavaDoc conn) throws SQLException JavaDoc;
68
69     boolean isValidated();
70
71     void drop(Connection JavaDoc conn) throws SQLException JavaDoc;
72 }
73
Popular Tags