com.triactive.jdo.store.sql
Class BaseTable
java.lang.Object
com.triactive.jdo.store.sql.AbstractTable
com.triactive.jdo.store.sql.BaseTable
- All Implemented Interfaces:
- Table
- Direct Known Subclasses:
- ClassBaseTable, com.triactive.jdo.store.sql.FieldTable, ProbeTable, SchemaTable
- public class BaseTable
- extends com.triactive.jdo.store.sql.AbstractTable
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
TABLE_STATE_CONSTRAINTS_INITIALIZED
protected static final int TABLE_STATE_CONSTRAINTS_INITIALIZED
- See Also:
- Constant Field Values
TABLE_STATE_CONSTRAINTS_FROZEN
protected static final int TABLE_STATE_CONSTRAINTS_FROZEN
- 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
dba
protected final DatabaseAdapter dba
name
protected final TableName name
state
protected int state
columnsByName
protected java.util.Map columnsByName
BaseTable
public BaseTable(TableName name,
DatabaseAdapter dba)
constraintsInitialized
public boolean constraintsInitialized()
constraintsFrozen
public boolean constraintsFrozen()
assertConstraintsUninitialized
protected void assertConstraintsUninitialized()
assertConstraintsInitialized
protected void assertConstraintsInitialized()
assertConstraintsNotFrozen
protected void assertConstraintsNotFrozen()
initialize
public void initialize(StoreManager.MgmtTransaction mtx)
initializeConstraints
public void initializeConstraints(StoreManager.MgmtTransaction mtx)
setPrimaryKey
public void setPrimaryKey(PrimaryKey pk)
addCandidateKey
public boolean addCandidateKey(CandidateKey ck)
addForeignKey
public boolean addForeignKey(ForeignKey fk)
addIndex
public boolean addIndex(Index idx)
intern
public Table intern()
- Description copied from interface:
Table
- Returns a canonical representation for the table object.
This method behaves much like String.intern()
.
A pool of tables, initially empty, is maintained privately.
When the intern method is invoked, if the pool already contains a table
equal to this Table
object as determined by the
equals(Object)
method, then the table from the pool is
returned.
Otherwise, this Table
object is added to the pool and a
reference to this Table
object is returned.
It follows that for any two tables t1
and t2
,
t1.intern() == t2.intern()
is true
if and only if t1.equals(t2)
is true
.
create
public void create(StoreManager.MgmtTransaction mtx)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
validate
public boolean validate(StoreManager.MgmtTransaction mtx)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
validateConstraints
public boolean validateConstraints(StoreManager.MgmtTransaction mtx)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
drop
public void drop(StoreManager.MgmtTransaction mtx)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
dropConstraints
public void dropConstraints(StoreManager.MgmtTransaction mtx)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
getSqlCreateStatements
protected java.util.List getSqlCreateStatements(StoreManager.MgmtTransaction mtx)
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(StoreManager.MgmtTransaction mtx)
hashCode
public int hashCode()
equals
public boolean equals(java.lang.Object obj)
getName
public TableName getName()
- Specified by:
getName
in interface Table
getDatabaseAdapter
public DatabaseAdapter getDatabaseAdapter()
- Specified by:
getDatabaseAdapter
in interface Table
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()
addColumn
public void addColumn(Column col)
- Specified by:
addColumn
in interface Table
hasColumnName
protected boolean hasColumnName(ColumnName 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,
ColumnName baseColName,
Role role)
- Specified by:
newColumn
in interface Table
exists
public boolean exists(StoreManager.MgmtTransaction mtx)
throws java.sql.SQLException
- Description copied from interface:
Table
- Tests if the database table exists.
- Specified by:
exists
in interface Table
- Parameters:
mtx
- the active management transaction
- Returns:
- true if the table exists in the database,
false otherwise.
- Throws:
java.sql.SQLException
toString
public final java.lang.String toString()
Copyright © 2001-2007 The TJDO Project All Rights Reserved.