com.triactive.jdo.store
Class FieldTable

java.lang.Object
  extended bycom.triactive.jdo.store.AbstractTable
      extended bycom.triactive.jdo.store.BaseTable
          extended bycom.triactive.jdo.store.JDOBaseTable
              extended bycom.triactive.jdo.store.FieldTable
All Implemented Interfaces:
JDOTable, Table
Direct Known Subclasses:
MapTable, SetTable

abstract class FieldTable
extends JDOBaseTable


Field Summary
static int AUTO_CREATE
          Bit flag passed to validate() to indicate that the table should be created if it is missing.
protected  java.util.ArrayList columns
           
protected  java.util.HashMap columnsByName
           
protected  DatabaseAdapter dba
           
protected  java.lang.reflect.Field field
           
protected  FieldMetaData fmd
           
protected  java.lang.String javaName
           
protected  SQLIdentifier name
           
protected  java.lang.Class ownerType
           
protected  int state
           
protected  StoreManager storeMgr
           
protected static int TABLE_STATE_INITIALIZED
           
protected static int TABLE_STATE_NEW
           
protected static int TABLE_STATE_VALIDATED
           
static int TABLE_TYPE_BASE_TABLE
          Returned by StoreManager.getTableType() if the table is a base table.
static int TABLE_TYPE_MISSING
          Returned by StoreManager.getTableType() if the table does not exist.
static int TABLE_TYPE_UNKNOWN
          Returned by StoreManager.getTableType() if the table type is not recognized.
static int TABLE_TYPE_VIEW
          Returned by StoreManager.getTableType() if the table is a view.
protected  int tableID
           
static int VALIDATE
          Bit flag passed to validate() to indicate that the table structure should be validated using JDBC metadata.
 
Constructor Summary
protected FieldTable(TableMetadata tmd, FieldMetaData fmd, 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)
           
 void dropConstraints(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.
protected  SQLIdentifier getBaseColumnNameForType(java.lang.Class c)
           
protected  java.util.List getExpectedForeignKeys()
           
protected  java.util.Set getExpectedIndices()
           
 PrimaryKey getExpectedPrimaryKey()
           
 java.lang.reflect.Field getField()
           
 java.lang.String getJavaName()
           
 SQLIdentifier getName()
           
 java.lang.String getSchemaName()
           
protected  java.util.Map getSQLAddFKStatements(java.util.Map actualForeignKeysByName)
           
protected  java.util.Map getSQLCreateIndexStatements(java.util.Map actualIndicesByName)
           
protected  java.util.List getSQLCreateStatements()
           
protected  java.util.List getSQLDropStatements()
           
 StoreManager getStoreManager()
           
 int getTableID()
           
protected  boolean hasColumnName(SQLIdentifier colName)
           
 int hashCode()
           
 void initialize()
           
 boolean isInitialized()
           
 boolean isValidated()
           
 Column newColumn(java.lang.Class type, SQLIdentifier name, Role role)
           
 Column newColumn(java.lang.Class type, java.lang.String javaName)
           
 OID newOID()
           
 java.lang.String toString()
           
 boolean validate(int flags, java.sql.Connection conn)
           
 boolean validateConstraints(int flags, java.sql.Connection conn)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

fmd

protected final FieldMetaData fmd

field

protected final java.lang.reflect.Field field

ownerType

protected final java.lang.Class ownerType

tableID

protected final int tableID

javaName

protected final java.lang.String javaName

TABLE_TYPE_MISSING

public static final int TABLE_TYPE_MISSING
Returned by StoreManager.getTableType() if the table does not exist.

See Also:
Constant Field Values

TABLE_TYPE_UNKNOWN

public static final int TABLE_TYPE_UNKNOWN
Returned by StoreManager.getTableType() if the table type is not recognized.

See Also:
Constant Field Values

TABLE_TYPE_BASE_TABLE

public static final int TABLE_TYPE_BASE_TABLE
Returned by StoreManager.getTableType() if the table is a base table.

See Also:
Constant Field Values

TABLE_TYPE_VIEW

public static final int TABLE_TYPE_VIEW
Returned by StoreManager.getTableType() if the table is a view.

See Also:
Constant Field Values

VALIDATE

public static final int VALIDATE
Bit flag passed to validate() to indicate that the table structure should be validated using JDBC metadata.

See Also:
Constant Field Values

AUTO_CREATE

public static final int AUTO_CREATE
Bit flag passed to validate() to indicate that the table should be created if it is missing.

See Also:
Constant Field Values

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

FieldTable

protected FieldTable(TableMetadata tmd,
                     FieldMetaData fmd,
                     StoreManager storeMgr)
Method Detail

getField

public java.lang.reflect.Field getField()

getBaseColumnNameForType

protected SQLIdentifier getBaseColumnNameForType(java.lang.Class c)

initialize

public void initialize()
Specified by:
initialize in interface Table

getTableID

public int getTableID()
Specified by:
getTableID in interface JDOTable

getJavaName

public java.lang.String getJavaName()
Specified by:
getJavaName in interface JDOTable

newOID

public final OID newOID()
Specified by:
newOID in interface JDOTable

isInitialized

public boolean isInitialized()

getName

public SQLIdentifier getName()

getStoreManager

public StoreManager getStoreManager()

getSchemaName

public java.lang.String getSchemaName()

addColumn

public void addColumn(Column col)

newColumn

public Column newColumn(java.lang.Class type,
                        java.lang.String javaName)

newColumn

public Column newColumn(java.lang.Class type,
                        SQLIdentifier name,
                        Role role)

exists

public boolean exists(java.sql.Connection conn)
               throws java.sql.SQLException
Throws:
java.sql.SQLException

create

public void create(java.sql.Connection conn)
            throws java.sql.SQLException
Throws:
java.sql.SQLException

validate

public boolean validate(int flags,
                        java.sql.Connection conn)
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

isValidated

public boolean isValidated()

drop

public void drop(java.sql.Connection conn)
          throws java.sql.SQLException
Throws:
java.sql.SQLException

getExpectedPrimaryKey

public PrimaryKey getExpectedPrimaryKey()

validateConstraints

public boolean validateConstraints(int flags,
                                   java.sql.Connection conn)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

dropConstraints

public void dropConstraints(java.sql.Connection conn)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

getExpectedForeignKeys

protected java.util.List getExpectedForeignKeys()

getExpectedIndices

protected java.util.Set getExpectedIndices()

getSQLCreateStatements

protected java.util.List getSQLCreateStatements()
Specified by:
getSQLCreateStatements in class AbstractTable

getSQLAddFKStatements

protected java.util.Map getSQLAddFKStatements(java.util.Map actualForeignKeysByName)

getSQLCreateIndexStatements

protected java.util.Map getSQLCreateIndexStatements(java.util.Map actualIndicesByName)

getSQLDropStatements

protected java.util.List getSQLDropStatements()
Specified by:
getSQLDropStatements in class AbstractTable

assertIsUninitialized

protected void assertIsUninitialized()

assertIsInitialized

protected void assertIsInitialized()

assertIsValidated

protected void assertIsValidated()

hasColumnName

protected boolean hasColumnName(SQLIdentifier colName)

executeStatementList

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

equals

public final boolean equals(java.lang.Object obj)

hashCode

public final int hashCode()

toString

public final java.lang.String toString()


Copyright ? 2001 TriActive, Inc. All Rights Reserved.