|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Representation of a table in a datastore.
There are 2 aspects to a table. The first is the internal representation, provided here. This has a state. The second aspect to the table is its external (datastore) representation. This reflects whether it exists, or whether it has been deleted, etc.
This interface provides some methods for mapping from the internal representation to the external representation. These are the methods
Field Summary | |
static int |
TABLE_STATE_INITIALIZED
Table object has been initialised. |
static int |
TABLE_STATE_INITIALIZED_MODIFIED
Table object has been initialized but has had structural modifications since. |
static int |
TABLE_STATE_NEW
Table object has just been created. |
static int |
TABLE_STATE_PK_INITIALIZED
Table object is created and PK initialised. |
static int |
TABLE_STATE_VALIDATED
Table object has been validated. |
static int |
TABLE_TYPE_MISSING
Returned by RDBMSStoreHelper.getTableType() if the table does not exist. |
static int |
TABLE_TYPE_TABLE
Returned by RDBMSStoreHelper.getTableType() if the table is a table. |
static int |
TABLE_TYPE_UNKNOWN
Returned by RDBMSStoreHelper.getTableType() if the table type is not recognized. |
static int |
TABLE_TYPE_VIEW
Returned by RDBMSStoreHelper.getTableType() if the table is a view. |
Method Summary | |
void |
create(java.sql.Connection conn)
Method to create the table in the datastore representation. |
void |
drop(java.sql.Connection conn)
Method to drop the table from the datastore representation. |
boolean |
exists(java.sql.Connection conn,
boolean create)
Accessor for whether the table exists in the datastore. |
java.lang.String |
getCatalogName()
Accessor for the Catalog name for this table. |
java.lang.String |
getSchemaName()
Accessor for the Schema name for this table. |
void |
initialize(ClassLoaderResolver clr)
Method to initialise the table. |
boolean |
isInitialized()
Accessor for whether the table has been initialised. |
boolean |
isInitializedModified()
Accessor for whether the table has been modified after being initialised. |
boolean |
isValidated()
Accessor for whether the table is validated. |
void |
postInitialize(ClassLoaderResolver clr)
Post initilize. |
void |
preInitialize(ClassLoaderResolver clr)
Pre initialize. |
boolean |
validate(java.sql.Connection conn,
boolean validateColumnStructure,
boolean autoCreate,
java.util.Collection autoCreateErrors)
Method to validate the table against what is in the datastore |
Methods inherited from interface org.jpox.store.DatastoreContainerObject |
addDatastoreField, getDiscriminatorMapping, getDiscriminatorMetaData, getFieldMapping, getIDMapping, getVersionMapping, getVersionMetaData, hasDatastoreField |
Methods inherited from interface org.jpox.store.DatastoreObject |
getIdentifier, getStoreManager |
Field Detail |
public static final int TABLE_TYPE_MISSING
public static final int TABLE_TYPE_UNKNOWN
public static final int TABLE_TYPE_TABLE
public static final int TABLE_TYPE_VIEW
public static final int TABLE_STATE_NEW
public static final int TABLE_STATE_PK_INITIALIZED
public static final int TABLE_STATE_INITIALIZED
public static final int TABLE_STATE_INITIALIZED_MODIFIED
public static final int TABLE_STATE_VALIDATED
Method Detail |
public java.lang.String getCatalogName()
public java.lang.String getSchemaName()
public void initialize(ClassLoaderResolver clr)
clr
- The ClassLoaderResolverpublic void preInitialize(ClassLoaderResolver clr)
clr
- the ClassLoaderResolverpublic void postInitialize(ClassLoaderResolver clr)
clr
- the ClassLoaderResolverpublic boolean isInitialized()
public boolean isInitializedModified()
public boolean validate(java.sql.Connection conn, boolean validateColumnStructure, boolean autoCreate, java.util.Collection autoCreateErrors) throws java.sql.SQLException
conn
- The connectionvalidateColumnStructure
- Whether to validate down to the column structure, or just the existenceautoCreate
- Whether to update the table to fix any errors.autoCreateErrors
- Errors found during the auto-create process
java.sql.SQLException
- Thrown if an error occurrs in the validationpublic boolean isValidated()
public boolean exists(java.sql.Connection conn, boolean create) throws java.sql.SQLException
conn
- The connecton to use to verify itcreate
- Whether to create it if it doesn't exist
java.sql.SQLException
- Thrown if an error occurs in the checkpublic void create(java.sql.Connection conn) throws java.sql.SQLException
conn
- The connection to use
java.sql.SQLException
- Thrown if an error occurspublic void drop(java.sql.Connection conn) throws java.sql.SQLException
conn
- The connection to use
java.sql.SQLException
- Thrown if an error occurs
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |