com.triactive.jdo.store
Class AbstractTable

java.lang.Object
  extended by com.triactive.jdo.store.AbstractTable
All Implemented Interfaces:
Table
Direct Known Subclasses:
BaseTable, View

abstract class AbstractTable
extends java.lang.Object
implements Table


Field Summary
protected  java.util.ArrayList columns
           
protected  java.util.HashMap columnsByName
           
protected  DatabaseAdapter dba
           
protected  SQLIdentifier name
           
protected  int state
           
protected  StoreManager storeMgr
           
protected static int TABLE_STATE_INITIALIZED
           
protected static int TABLE_STATE_NEW
           
protected static int TABLE_STATE_VALIDATED
           
 
Fields inherited from interface com.triactive.jdo.store.Table
AUTO_CREATE, TABLE_TYPE_BASE_TABLE, TABLE_TYPE_MISSING, TABLE_TYPE_UNKNOWN, TABLE_TYPE_VIEW, VALIDATE
 
Constructor Summary
AbstractTable(SQLIdentifier name, StoreManager storeMgr)
           
AbstractTable(StoreManager storeMgr)
           
 
Method Summary
 void addColumn(Column col)
           
protected  void assertIsInitialized()
           
protected  void assertIsUninitialized()
           
protected  void assertIsValidated()
           
 void create(java.sql.Connection conn)
           
 void drop(java.sql.Connection conn)
           
 boolean equals(java.lang.Object obj)
           
protected  void executeStatementList(java.util.List stmts, java.sql.Connection conn)
           
 boolean exists(java.sql.Connection conn)
          Tests if the database table exists.
 SQLIdentifier getName()
           
 java.lang.String getSchemaName()
           
protected abstract  java.util.List getSQLCreateStatements()
           
protected abstract  java.util.List getSQLDropStatements()
           
 StoreManager getStoreManager()
           
protected  boolean hasColumnName(SQLIdentifier colName)
           
 int hashCode()
           
 boolean isInitialized()
           
 boolean isValidated()
           
 Column newColumn(java.lang.Class type, SQLIdentifier name, Role role)
           
 Column newColumn(java.lang.Class type, java.lang.String javaName)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.triactive.jdo.store.Table
initialize, validate
 

Field Detail

TABLE_STATE_NEW

protected static final int TABLE_STATE_NEW
See Also:
Constant Field Values

TABLE_STATE_INITIALIZED

protected static final int TABLE_STATE_INITIALIZED
See Also:
Constant Field Values

TABLE_STATE_VALIDATED

protected static final int TABLE_STATE_VALIDATED
See Also:
Constant Field Values

storeMgr

protected final StoreManager storeMgr

dba

protected final DatabaseAdapter dba

name

protected SQLIdentifier name

state

protected int state

columns

protected java.util.ArrayList columns

columnsByName

protected java.util.HashMap columnsByName
Constructor Detail

AbstractTable

public AbstractTable(StoreManager storeMgr)

AbstractTable

public AbstractTable(SQLIdentifier name,
                     StoreManager storeMgr)
Method Detail

isInitialized

public boolean isInitialized()
Specified by:
isInitialized in interface Table

isValidated

public boolean isValidated()
Specified by:
isValidated in interface Table

assertIsUninitialized

protected void assertIsUninitialized()

assertIsInitialized

protected void assertIsInitialized()

assertIsValidated

protected void assertIsValidated()

getName

public SQLIdentifier getName()
Specified by:
getName in interface Table

getStoreManager

public StoreManager getStoreManager()
Specified by:
getStoreManager in interface Table

getSchemaName

public java.lang.String getSchemaName()
Specified by:
getSchemaName in interface Table

addColumn

public void addColumn(Column col)
Specified by:
addColumn in interface Table

hasColumnName

protected boolean hasColumnName(SQLIdentifier colName)

newColumn

public Column newColumn(java.lang.Class type,
                        java.lang.String javaName)
Specified by:
newColumn in interface Table

newColumn

public Column newColumn(java.lang.Class type,
                        SQLIdentifier name,
                        Role role)
Specified by:
newColumn in interface Table

executeStatementList

protected void executeStatementList(java.util.List stmts,
                                    java.sql.Connection conn)
                             throws java.sql.SQLException
Throws:
java.sql.SQLException

getSQLCreateStatements

protected abstract java.util.List getSQLCreateStatements()

getSQLDropStatements

protected abstract java.util.List getSQLDropStatements()

create

public void create(java.sql.Connection conn)
            throws java.sql.SQLException
Specified by:
create in interface Table
Throws:
java.sql.SQLException

drop

public void drop(java.sql.Connection conn)
          throws java.sql.SQLException
Specified by:
drop in interface Table
Throws:
java.sql.SQLException

exists

public boolean exists(java.sql.Connection conn)
               throws java.sql.SQLException
Tests if the database table exists.

Specified by:
exists in interface Table
Parameters:
conn - a JDBC connection to the database.
Returns:
true if the table exists in the database, false otherwise.
Throws:
java.sql.SQLException

equals

public final boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright ? 2001 TriActive, Inc. All Rights Reserved.