public interface Table
extends org.datanucleus.store.schema.table.Table
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
Modifier and Type | Method and Description |
---|---|
Column |
addColumn(String storedJavaType,
DatastoreIdentifier name,
JavaTypeMapping mapping,
org.datanucleus.metadata.ColumnMetaData colmd)
Method to add a new column to the internal representation.
|
boolean |
create(Connection conn)
Method to create the table in the datastore representation.
|
void |
drop(Connection conn)
Method to drop the table from the datastore representation.
|
boolean |
exists(Connection conn,
boolean create)
Accessor for whether the table exists in the datastore.
|
Column |
getColumn(DatastoreIdentifier identifier)
Accessor for the Datastore field with the specified identifier.
|
JavaTypeMapping |
getDiscriminatorMapping(boolean allowSuperclasses)
Accessor for the discriminator mapping specified.
|
org.datanucleus.metadata.DiscriminatorMetaData |
getDiscriminatorMetaData()
Accessor for Discriminator MetaData.
|
DatastoreIdentifier |
getIdentifier()
Accessor for the identifier for this object.
|
JavaTypeMapping |
getIdMapping()
Accessor for the ID mapping of this container object.
|
JavaTypeMapping |
getMemberMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Accessor for the mapping for the specified FieldMetaData.
|
JavaTypeMapping |
getMultitenancyMapping()
Accessor for the multi-tenancy mapping (if any).
|
RDBMSStoreManager |
getStoreManager() |
JavaTypeMapping |
getVersionMapping(boolean allowSuperclasses)
Accessor for the version mapping.
|
org.datanucleus.metadata.VersionMetaData |
getVersionMetaData()
Accessor for the Version MetaData.
|
boolean |
hasColumn(DatastoreIdentifier identifier)
Checks if there is a column for the identifier
|
void |
initialize(org.datanucleus.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(org.datanucleus.ClassLoaderResolver clr)
Post-initialize; for things that must be set after all classes have been initialized.
|
void |
preInitialize(org.datanucleus.ClassLoaderResolver clr)
Pre-initialize method; for things that must be initialized right after construction.
|
boolean |
validate(Connection conn,
boolean validateColumnStructure,
boolean autoCreate,
Collection autoCreateErrors)
Method to validate the table against what is in the datastore.
|
getCatalogName, getClassMetaData, getColumnForName, getColumnForPosition, getColumns, getDatastoreIdColumn, getDiscriminatorColumn, getMemberColumnMappingForEmbeddedMember, getMemberColumnMappingForMember, getMemberColumnMappings, getMultitenancyColumn, getName, getNumberOfColumns, getSchemaName, getVersionColumn
RDBMSStoreManager getStoreManager()
getStoreManager
in interface org.datanucleus.store.schema.table.Table
DatastoreIdentifier getIdentifier()
Column addColumn(String storedJavaType, DatastoreIdentifier name, JavaTypeMapping mapping, org.datanucleus.metadata.ColumnMetaData colmd)
storedJavaType
- The type of the Java field to storename
- The name of the columnmapping
- The type mapping for this columncolmd
- The column MetaDataboolean hasColumn(DatastoreIdentifier identifier)
identifier
- the identifier of the columnColumn getColumn(DatastoreIdentifier identifier)
identifier
- The name of the columnJavaTypeMapping getIdMapping()
JavaTypeMapping getMemberMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd)
mmd
- Metadata for the field/propertyorg.datanucleus.metadata.DiscriminatorMetaData getDiscriminatorMetaData()
JavaTypeMapping getDiscriminatorMapping(boolean allowSuperclasses)
allowSuperclasses
- Whether we should return just the mapping from this table
or whether we should return it when this table has none and the supertable hasJavaTypeMapping getMultitenancyMapping()
org.datanucleus.metadata.VersionMetaData getVersionMetaData()
JavaTypeMapping getVersionMapping(boolean allowSuperclasses)
allowSuperclasses
- Whether we should return just the mapping from this table
or whether we should return it when this table has none and the supertable hasvoid preInitialize(org.datanucleus.ClassLoaderResolver clr)
clr
- the ClassLoaderResolvervoid initialize(org.datanucleus.ClassLoaderResolver clr)
clr
- The ClassLoaderResolvervoid postInitialize(org.datanucleus.ClassLoaderResolver clr)
clr
- the ClassLoaderResolverboolean isInitialized()
boolean isInitializedModified()
boolean validate(Connection conn, boolean validateColumnStructure, boolean autoCreate, Collection autoCreateErrors) throws 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 processSQLException
- Thrown if an error occurrs in the validationboolean isValidated()
boolean exists(Connection conn, boolean create) throws SQLException
conn
- The connecton to use to verify itcreate
- Whether to create it if it doesn't existSQLException
- Thrown if an error occurs in the checkboolean create(Connection conn) throws SQLException
conn
- The connection to useSQLException
- Thrown if an error occurs creating the table.void drop(Connection conn) throws SQLException
conn
- The connection to useSQLException
- Thrown if an error occursCopyright © 2015. All rights reserved.