|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.triactive.jdo.store.AbstractTable
com.triactive.jdo.store.BaseTable
com.triactive.jdo.store.SchemaTable
| 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 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
|
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. |
static int |
VALIDATE
Bit flag passed to validate() to indicate that the table structure should be validated using JDBC metadata. |
| Constructor Summary | |
SchemaTable(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 |
dropAllTables(java.sql.Connection conn)
|
void |
dropConstraints(java.sql.Connection conn)
|
void |
dropTablesFor(java.lang.Class[] classes,
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. |
java.util.List |
getAllTableMetadata(boolean descending,
java.sql.Connection conn)
|
protected java.util.List |
getExpectedForeignKeys()
|
protected java.util.Set |
getExpectedIndices()
|
PrimaryKey |
getExpectedPrimaryKey()
|
java.lang.String |
getJavaName(int tableID,
java.sql.Connection conn)
|
SQLIdentifier |
getName()
|
int |
getNextOIDHiValue(int tableID,
java.sql.Connection conn)
|
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()
|
TableMetadata |
getTableMetadata(MetaData md,
java.sql.Connection conn)
Retrieve the TableMetadata for the given MetaData. |
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)
|
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 |
protected static final int TABLE_STATE_NEW
protected static final int TABLE_STATE_INITIALIZED
protected static final int TABLE_STATE_VALIDATED
protected final StoreManager storeMgr
protected final DatabaseAdapter dba
protected SQLIdentifier name
protected int state
protected java.util.ArrayList columns
protected java.util.HashMap columnsByName
public static final int TABLE_TYPE_MISSING
public static final int TABLE_TYPE_UNKNOWN
public static final int TABLE_TYPE_BASE_TABLE
public static final int TABLE_TYPE_VIEW
public static final int VALIDATE
public static final int AUTO_CREATE
| Constructor Detail |
public SchemaTable(StoreManager storeMgr)
| Method Detail |
public void initialize()
public boolean validate(int flags,
java.sql.Connection conn)
throws java.sql.SQLException
validate in interface Tablevalidate in class BaseTablejava.sql.SQLException
public boolean exists(java.sql.Connection conn)
throws java.sql.SQLException
AbstractTable
exists in interface Tableexists in class AbstractTableconn - a JDBC connection to the database.
java.sql.SQLException
public TableMetadata getTableMetadata(MetaData md,
java.sql.Connection conn)
throws java.sql.SQLException,
MissingSchemaTableEntryException
tableValidationFlags do not
specify AUTO_CREATE, a MissingSchemaTableEntryException is thrown.
md - The MetaData to retrieve the TableMetaData for.conn - The Connection to use.
java.sql.SQLException - If inserting the TableMetadata into the SchemaTable failed.
MissingSchemaTableEntryException - The the SchemaTable does not contain a row for the requested MetaData, and
tableValidationFlags does not specifiy AUTO_CREATE.
public java.lang.String getJavaName(int tableID,
java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLException
public int getNextOIDHiValue(int tableID,
java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLException
public java.util.List getAllTableMetadata(boolean descending,
java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLException
public void dropTablesFor(java.lang.Class[] classes,
java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLException
public void dropAllTables(java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLExceptionpublic PrimaryKey getExpectedPrimaryKey()
public void create(java.sql.Connection conn)
throws java.sql.SQLException
create in interface Tablecreate in class AbstractTablejava.sql.SQLException
public boolean validateConstraints(int flags,
java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLException
public void drop(java.sql.Connection conn)
throws java.sql.SQLException
drop in interface Tabledrop in class AbstractTablejava.sql.SQLException
public void dropConstraints(java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLExceptionprotected java.util.List getExpectedForeignKeys()
protected java.util.Set getExpectedIndices()
protected java.util.List getSQLCreateStatements()
getSQLCreateStatements in class AbstractTableprotected java.util.Map getSQLAddFKStatements(java.util.Map actualForeignKeysByName)
protected java.util.Map getSQLCreateIndexStatements(java.util.Map actualIndicesByName)
protected java.util.List getSQLDropStatements()
getSQLDropStatements in class AbstractTablepublic boolean isInitialized()
isInitialized in interface Tablepublic boolean isValidated()
isValidated in interface Tableprotected void assertIsUninitialized()
protected void assertIsInitialized()
protected void assertIsValidated()
public SQLIdentifier getName()
getName in interface Tablepublic StoreManager getStoreManager()
getStoreManager in interface Tablepublic java.lang.String getSchemaName()
getSchemaName in interface Tablepublic void addColumn(Column col)
addColumn in interface Tableprotected boolean hasColumnName(SQLIdentifier colName)
public Column newColumn(java.lang.Class type,
java.lang.String javaName)
newColumn in interface Table
public Column newColumn(java.lang.Class type,
SQLIdentifier name,
Role role)
newColumn in interface Table
protected void executeStatementList(java.util.List stmts,
java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLExceptionpublic final boolean equals(java.lang.Object obj)
public final int hashCode()
public final java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||