public abstract class AbstractClassTable extends TableImpl
Modifier and Type | Field and Description |
---|---|
protected JavaTypeMapping |
datastoreIDMapping
Mapping for datastore identity (optional).
|
protected JavaTypeMapping |
discriminatorMapping
Mapping for any discriminator column.
|
protected org.datanucleus.metadata.DiscriminatorMetaData |
discriminatorMetaData
MetaData for discriminator for objects stored in this table.
|
protected int |
highestMemberNumber
Highest absolute field/property number managed by this table
|
protected JavaTypeMapping |
idMapping
Mapping for the id of the table.
|
protected Map<org.datanucleus.metadata.AbstractMemberMetaData,JavaTypeMapping> |
memberMappingsMap
Mappings for members mapped to this table, keyed by the metadata for the member.
|
protected JavaTypeMapping[] |
pkMappings
Mappings for application identity (optional).
|
protected JavaTypeMapping |
tenantMapping
Mapping for multi-tenancy.
|
protected JavaTypeMapping |
versionMapping
Mapping for any version/timestamp column.
|
protected org.datanucleus.metadata.VersionMetaData |
versionMetaData
MetaData for versioning of objects stored in this table.
|
columns, columnsByName, dba, existsInDatastore, identifier, state, storeMgr, TABLE_STATE_INITIALIZED, TABLE_STATE_INITIALIZED_MODIFIED, TABLE_STATE_NEW, TABLE_STATE_PK_INITIALIZED, TABLE_STATE_VALIDATED
Constructor and Description |
---|
AbstractClassTable(DatastoreIdentifier tableName,
RDBMSStoreManager storeMgr)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addMemberMapping(JavaTypeMapping fieldMapping)
Utility to add the mapping for a field/property to the managed list.
|
protected void |
addMultitenancyMapping(org.datanucleus.metadata.ColumnMetaData colmd)
Method to add a multi-tenancy discriminator column.
|
org.datanucleus.store.schema.table.Column |
getDatastoreIdColumn() |
JavaTypeMapping |
getDatastoreIdMapping()
Accessor for a mapping for the datastore ID for this table.
|
org.datanucleus.store.schema.table.Column |
getDiscriminatorColumn() |
JavaTypeMapping |
getDiscriminatorMapping(boolean allowSuperclasses)
Accessor for the discriminator mapping specified.
|
abstract org.datanucleus.metadata.IdentityType |
getIdentityType()
Accessor for the identity-type.
|
protected JavaTypeMapping |
getMappingForMemberName(String memberName)
Accessor for the JavaTypeMapping that is handling the member of the specified name.
|
org.datanucleus.store.schema.table.Column |
getMultitenancyColumn() |
JavaTypeMapping |
getMultitenancyMapping()
Accessor for the multi-tenancy mapping (if any).
|
Table |
getPrimaryTable()
Convenience method to return the primary table.
|
org.datanucleus.store.schema.table.Column |
getVersionColumn() |
JavaTypeMapping |
getVersionMapping(boolean allowSuperclasses)
Accessor for the version mapping specified .
|
protected abstract void |
initializePK(org.datanucleus.ClassLoaderResolver clr)
Method to initialise the table primary key field(s).
|
abstract boolean |
isObjectIdDatastoreAttributed()
Accessor for whether the table has its identity attributed
by the datastore (e.g using autoincrement)
|
boolean |
managesMapping(JavaTypeMapping mapping)
Convenience method to return if this table manages the columns for the supplied mapping.
|
boolean |
managesMember(String memberName)
Convenience method for whether the (fully-specified) member is managed by this table
|
void |
provideDatastoreIdMappings(MappingConsumer consumer)
Accessor for a mapping for the datastore ID (OID) for this table.
|
void |
provideDiscriminatorMappings(MappingConsumer consumer)
Provide the discriminator mappings
|
void |
provideMappingsForMembers(MappingConsumer consumer,
org.datanucleus.metadata.AbstractMemberMetaData[] mmds,
boolean includeSecondaryTables)
Provide the mappings to the consumer for all specified members.
|
void |
provideMultitenancyMapping(MappingConsumer consumer)
Provide the multitenancy mapping.
|
void |
provideNonPrimaryKeyMappings(MappingConsumer consumer)
Provide the mappings to the consumer for all non primary-key fields
mapped to this table.
|
abstract void |
providePrimaryKeyMappings(MappingConsumer consumer)
Provide the mappings to the consumer for all primary-key fields mapped to
this table (for application identity).
|
void |
provideVersionMappings(MappingConsumer consumer)
Provide the version mappings.
|
createConstraints, dropConstraints, getExpectedCandidateKeys, getExpectedForeignKeys, getExpectedIndices, getPrimaryKey, getSQLAddCandidateKeyStatements, getSQLAddFKStatements, getSQLCreateIndexStatements, getSQLCreateStatements, getSQLDropStatements, initializeColumnInfoForPrimaryKeyColumns, initializeColumnInfoFromDatastore, logMapping, postInitialize, preInitialize, validate, validateColumns, validateConstraints, validatePrimaryKey
addColumn, addColumnInternal, allowDDLOutput, assertIsInitialized, assertIsInitializedModified, assertIsPKInitialized, assertIsPKUninitialized, assertIsUninitialized, assertIsValidated, create, drop, equals, executeDdlStatement, executeDdlStatementList, exists, getCatalogName, getClassMetaData, getColumn, getColumnForName, getColumnForPosition, getColumns, getDatastoreIdentifierFullyQualified, getDiscriminatorMetaData, getIdentifier, getMemberColumnMappingForEmbeddedMember, getMemberColumnMappingForMember, getMemberColumnMappings, getName, getNumberOfColumns, getSchemaName, getStoreManager, getVersionMetaData, hasColumn, hasColumnName, hashCode, isInitialized, isInitializedModified, isPKInitialized, isValidated, tableExistsInDatastore, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getIdMapping, getMemberMapping, initialize
protected Map<org.datanucleus.metadata.AbstractMemberMetaData,JavaTypeMapping> memberMappingsMap
protected JavaTypeMapping datastoreIDMapping
protected JavaTypeMapping[] pkMappings
protected JavaTypeMapping idMapping
protected JavaTypeMapping versionMapping
protected org.datanucleus.metadata.VersionMetaData versionMetaData
protected org.datanucleus.metadata.DiscriminatorMetaData discriminatorMetaData
protected JavaTypeMapping discriminatorMapping
protected int highestMemberNumber
protected JavaTypeMapping tenantMapping
public AbstractClassTable(DatastoreIdentifier tableName, RDBMSStoreManager storeMgr)
tableName
- Name of the tablestoreMgr
- Store Manager that is managing this instancepublic Table getPrimaryTable()
protected abstract void initializePK(org.datanucleus.ClassLoaderResolver clr)
clr
- The ClassLoaderResolverpublic boolean managesMember(String memberName)
memberName
- Fully qualified name of the field/propertyprotected JavaTypeMapping getMappingForMemberName(String memberName)
memberName
- Name of the field/propertypublic boolean managesMapping(JavaTypeMapping mapping)
mapping
- The mappingprotected void addMultitenancyMapping(org.datanucleus.metadata.ColumnMetaData colmd)
colmd
- Metadata defining the column requiredprotected void addMemberMapping(JavaTypeMapping fieldMapping)
fieldMapping
- The mapping for the field/propertypublic abstract org.datanucleus.metadata.IdentityType getIdentityType()
public abstract boolean isObjectIdDatastoreAttributed()
public JavaTypeMapping getDatastoreIdMapping()
public org.datanucleus.store.schema.table.Column getDatastoreIdColumn()
getDatastoreIdColumn
in interface org.datanucleus.store.schema.table.Table
getDatastoreIdColumn
in class AbstractTable
public JavaTypeMapping getVersionMapping(boolean allowSuperclasses)
getVersionMapping
in class AbstractTable
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 haspublic org.datanucleus.store.schema.table.Column getVersionColumn()
getVersionColumn
in interface org.datanucleus.store.schema.table.Table
getVersionColumn
in class AbstractTable
public JavaTypeMapping getDiscriminatorMapping(boolean allowSuperclasses)
getDiscriminatorMapping
in class AbstractTable
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 haspublic org.datanucleus.store.schema.table.Column getDiscriminatorColumn()
getDiscriminatorColumn
in interface org.datanucleus.store.schema.table.Table
getDiscriminatorColumn
in class AbstractTable
public JavaTypeMapping getMultitenancyMapping()
Table
getMultitenancyMapping
in class AbstractTable
public org.datanucleus.store.schema.table.Column getMultitenancyColumn()
getMultitenancyColumn
in interface org.datanucleus.store.schema.table.Table
getMultitenancyColumn
in class AbstractTable
public final void provideDatastoreIdMappings(MappingConsumer consumer)
consumer
- Consumer for the mappingspublic abstract void providePrimaryKeyMappings(MappingConsumer consumer)
consumer
- Consumer for the mappingspublic final void provideNonPrimaryKeyMappings(MappingConsumer consumer)
consumer
- Consumer for the mappingspublic void provideMappingsForMembers(MappingConsumer consumer, org.datanucleus.metadata.AbstractMemberMetaData[] mmds, boolean includeSecondaryTables)
consumer
- Consumer for the mappingsmmds
- MetaData for the members to provide mappings forincludeSecondaryTables
- Whether to provide members in secondary tablespublic final void provideVersionMappings(MappingConsumer consumer)
consumer
- Consumer for the version mappingspublic final void provideDiscriminatorMappings(MappingConsumer consumer)
consumer
- Consumer for the mappingspublic final void provideMultitenancyMapping(MappingConsumer consumer)
consumer
- Consumer for the mappingCopyright © 2015. All rights reserved.