public class ClassTable extends AbstractClassTable implements DatastoreClass
| Modifier and Type | Field and Description |
|---|---|
protected String |
managingClassCurrent
Name of class currently being processed in manageClass (if any).
|
protected boolean |
runCallbacksAfterManageClass
Flag to run the callbacks after the current class is managed fully.
|
datastoreIDMapping, discriminatorMapping, discriminatorMetaData, highestMemberNumber, idMapping, memberMappingsMap, pkMappings, tenantMapping, versionMapping, versionMetaDatacolumns, columnsByIdentifier, 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 |
|---|
ClassTable(DatastoreIdentifier tableName,
RDBMSStoreManager storeMgr,
org.datanucleus.metadata.ClassMetaData cmd)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
DatastoreClass |
getBaseDatastoreClass()
Accessor for the base datastore class.
|
DatastoreClass |
getBaseDatastoreClassWithMember(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Convenience accessor for the base table for this table which has the specified field.
|
org.datanucleus.metadata.ClassMetaData |
getClassMetaData()
Accessor for the (primary) class MetaData.
|
JavaTypeMapping |
getDiscriminatorMapping(boolean allowSuperclasses)
Accessor for the discriminator mapping specified .
|
org.datanucleus.metadata.DiscriminatorMetaData |
getDiscriminatorMetaData()
Accessor for Discriminator MetaData
|
protected List<CandidateKey> |
getExpectedCandidateKeys()
Accessor for the expected candidate keys for this table.
|
List<ForeignKey> |
getExpectedForeignKeys(org.datanucleus.ClassLoaderResolver clr)
Accessor for the expected foreign keys for this table.
|
protected Set<Index> |
getExpectedIndices(org.datanucleus.ClassLoaderResolver clr)
Accessor for the indices for this table.
|
JavaTypeMapping |
getExternalMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd,
int mappingType)
Accessor for an external mapping for the specified field of the required type.
|
org.datanucleus.metadata.IdentityType |
getIdentityType()
Accessor for the identity-type.
|
JavaTypeMapping |
getIdMapping()
Accessor for a mapping for the ID (persistable) for this table.
|
String[] |
getManagedClasses()
Accessor for the names of all classes managed by this table.
|
JavaTypeMapping |
getMemberMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Accessor for the field mapping for the specified field.
|
JavaTypeMapping |
getMemberMapping(String memberName)
Accessor for the field mapping for the named field.
|
JavaTypeMapping |
getMemberMappingInDatastoreClass(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Accessor for the mapping for the specified field only in this datastore class.
|
org.datanucleus.metadata.AbstractMemberMetaData |
getMetaDataForExternalMapping(JavaTypeMapping mapping,
int mappingType)
Accessor for the MetaData for the (owner) field that an external mapping corresponds to.
|
PrimaryKey |
getPrimaryKey()
Accessor for the primary key for this table.
|
Collection |
getSecondaryDatastoreClasses()
Accessor for any secondary tables for this table.
|
protected List |
getSQLCreateStatements(Properties props)
Accessor for the CREATE statements for this table.
|
protected List |
getSQLDropStatements()
Accessor for the DROP statements for this table.
|
DatastoreClass |
getSuperDatastoreClass()
Accessor for the supertable for this table.
|
ClassTable |
getTableManagingMapping(JavaTypeMapping mapping) |
ClassTable |
getTableWithDiscriminator()
Convenience method to return the root table with a discriminator in this inheritance tree.
|
String |
getType()
Accessor for the main class represented.
|
JavaTypeMapping |
getVersionMapping(boolean allowSuperclasses)
Accessor for the version mapping specified .
|
org.datanucleus.metadata.VersionMetaData |
getVersionMetaData()
Accessor for versionMetaData
|
boolean |
hasExternalFkMappings() |
void |
initialize(org.datanucleus.ClassLoaderResolver clr)
Method to initialise the table.
|
protected void |
initializePK(org.datanucleus.ClassLoaderResolver clr)
Method to initialise the table primary key field(s).
|
boolean |
isBaseDatastoreClass()
Whether this table is the base table in the inheritance hierarchy.
|
boolean |
isObjectIdDatastoreAttributed()
Whether this table or super table has id (primary key) attributed by the datastore
|
boolean |
isSuperDatastoreClass(DatastoreClass table)
Accessor whether the supplied DatastoreClass is a supertable of this table.
|
void |
manageClass(org.datanucleus.metadata.AbstractClassMetaData theCmd,
org.datanucleus.ClassLoaderResolver clr)
Method that adds the specified class to be managed by this table.
|
boolean |
managesClass(String className)
Accessor for whether this table manages the specified class
|
void |
postInitialize(org.datanucleus.ClassLoaderResolver clr)
Post initilize.
|
void |
preInitialize(org.datanucleus.ClassLoaderResolver clr)
Pre-initialize.
|
void |
provideExternalMappings(MappingConsumer consumer,
int mappingType)
Provide the mappings to the consumer for all external fields mapped to this table
of the specified type
|
void |
provideMappingsForMembers(MappingConsumer consumer,
org.datanucleus.metadata.AbstractMemberMetaData[] fieldMetaData,
boolean includeSecondaryTables)
Provide the mappings to the consumer for all absolute field Numbers in this table
that are container in the fieldNumbers parameter.
|
void |
providePrimaryKeyMappings(MappingConsumer consumer)
Provide the mappings to the consumer for all primary-key fields mapped to
this table.
|
void |
provideUnmappedColumns(MappingConsumer consumer)
Method to provide all unmapped columns to the consumer.
|
boolean |
validateConstraints(Connection conn,
boolean autoCreate,
Collection autoCreateErrors,
org.datanucleus.ClassLoaderResolver clr)
Method to validate the constraints of this table.
|
addMemberMapping, addMultitenancyMapping, getDatastoreIdColumn, getDatastoreIdMapping, getDiscriminatorColumn, getMappingForMemberName, getMultitenancyColumn, getMultitenancyMapping, getPrimaryTable, getVersionColumn, managesMapping, managesMember, provideDatastoreIdMappings, provideDiscriminatorMappings, provideMultitenancyMapping, provideNonPrimaryKeyMappings, provideVersionMappingscreateConstraints, dropConstraints, getSQLAddCandidateKeyStatements, getSQLAddFKStatements, getSQLCreateIndexStatements, initializeColumnInfoForPrimaryKeyColumns, initializeColumnInfoFromDatastore, logMapping, validate, validateColumns, validatePrimaryKeyaddColumn, addColumnInternal, allowDDLOutput, assertIsInitialized, assertIsInitializedModified, assertIsPKInitialized, assertIsPKUninitialized, assertIsUninitialized, assertIsValidated, create, drop, equals, executeDdlStatement, executeDdlStatementList, exists, getCatalogName, getColumn, getColumnForName, getColumnForPosition, getColumns, getDatastoreIdentifierFullyQualified, getIdentifier, getMemberColumnMappingForEmbeddedMember, getMemberColumnMappingForMember, getMemberColumnMappings, getName, getNumberOfColumns, getSchemaName, getStoreManager, hasColumn, hasColumnName, hashCode, isInitialized, isInitializedModified, isPKInitialized, isValidated, tableExistsInDatastore, toStringclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetDatastoreIdMapping, managesMapping, provideDatastoreIdMappings, provideDiscriminatorMappings, provideMultitenancyMapping, provideNonPrimaryKeyMappings, provideVersionMappings, toStringaddColumn, create, drop, exists, getColumn, getIdentifier, getMultitenancyMapping, getStoreManager, hasColumn, isInitialized, isInitializedModified, isValidated, validategetCatalogName, getColumnForName, getColumnForPosition, getColumns, getDatastoreIdColumn, getDiscriminatorColumn, getMemberColumnMappingForEmbeddedMember, getMemberColumnMappingForMember, getMemberColumnMappings, getMultitenancyColumn, getName, getNumberOfColumns, getSchemaName, getVersionColumnprotected transient String managingClassCurrent
protected boolean runCallbacksAfterManageClass
public ClassTable(DatastoreIdentifier tableName, RDBMSStoreManager storeMgr, org.datanucleus.metadata.ClassMetaData cmd)
tableName - Table name SQL identifierstoreMgr - Store Manager to manage this tablecmd - MetaData for the class.public void preInitialize(org.datanucleus.ClassLoaderResolver clr)
preInitialize in class TableImplclr - the ClassLoaderResolverpublic void initialize(org.datanucleus.ClassLoaderResolver clr)
clr - The ClassLoaderResolverpublic void postInitialize(org.datanucleus.ClassLoaderResolver clr)
postInitialize in class TableImplclr - the ClassLoaderResolverpublic void manageClass(org.datanucleus.metadata.AbstractClassMetaData theCmd,
org.datanucleus.ClassLoaderResolver clr)
theCmd - ClassMetaData for the class to be managedclr - The ClassLoaderResolverpublic String[] getManagedClasses()
getManagedClasses in interface DatastoreClasspublic boolean managesClass(String className)
managesClass in interface DatastoreClassclassName - Name of the classprotected void initializePK(org.datanucleus.ClassLoaderResolver clr)
initializePK in class AbstractClassTableclr - The ClassLoaderResolverpublic String getType()
getType in interface DatastoreClasspublic org.datanucleus.metadata.IdentityType getIdentityType()
getIdentityType in interface DatastoreClassgetIdentityType in class AbstractClassTablepublic final org.datanucleus.metadata.VersionMetaData getVersionMetaData()
getVersionMetaData in class AbstractTablepublic final org.datanucleus.metadata.DiscriminatorMetaData getDiscriminatorMetaData()
getDiscriminatorMetaData in class AbstractTablepublic final ClassTable getTableWithDiscriminator()
public boolean isObjectIdDatastoreAttributed()
isObjectIdDatastoreAttributed in interface DatastoreClassisObjectIdDatastoreAttributed in class AbstractClassTablepublic boolean isBaseDatastoreClass()
isBaseDatastoreClass in interface DatastoreClasspublic DatastoreClass getBaseDatastoreClass()
DatastoreClassgetBaseDatastoreClass in interface DatastoreClasspublic DatastoreClass getSuperDatastoreClass()
getSuperDatastoreClass in interface DatastoreClasspublic boolean isSuperDatastoreClass(DatastoreClass table)
isSuperDatastoreClass in interface DatastoreClasstable - The DatastoreClass to checkpublic Collection getSecondaryDatastoreClasses()
getSecondaryDatastoreClasses in interface DatastoreClasspublic JavaTypeMapping getVersionMapping(boolean allowSuperclasses)
getVersionMapping in class AbstractClassTableallowSuperclasses - 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 JavaTypeMapping getDiscriminatorMapping(boolean allowSuperclasses)
getDiscriminatorMapping in class AbstractClassTableallowSuperclasses - 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 ClassTable getTableManagingMapping(JavaTypeMapping mapping)
public DatastoreClass getBaseDatastoreClassWithMember(org.datanucleus.metadata.AbstractMemberMetaData mmd)
getBaseDatastoreClassWithMember in interface DatastoreClassmmd - Field MetaData for this fieldpublic org.datanucleus.metadata.ClassMetaData getClassMetaData()
getClassMetaData in interface org.datanucleus.store.schema.table.TablegetClassMetaData in class AbstractTableprotected Set<Index> getExpectedIndices(org.datanucleus.ClassLoaderResolver clr)
getExpectedIndices in class TableImplclr - The ClassLoaderResolverpublic List<ForeignKey> getExpectedForeignKeys(org.datanucleus.ClassLoaderResolver clr)
getExpectedForeignKeys in class TableImplclr - The ClassLoaderResolverprotected List<CandidateKey> getExpectedCandidateKeys()
getExpectedCandidateKeys in class TableImplpublic PrimaryKey getPrimaryKey()
getPrimaryKey in class TableImplprotected List getSQLCreateStatements(Properties props)
getSQLCreateStatements in class TableImplprops - Properties for creating the tableprotected List getSQLDropStatements()
getSQLDropStatements in class TableImplpublic JavaTypeMapping getIdMapping()
public boolean hasExternalFkMappings()
public JavaTypeMapping getExternalMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd, int mappingType)
getExternalMapping in interface DatastoreClassmmd - MetaData for the field/propertymappingType - Type of mappingpublic org.datanucleus.metadata.AbstractMemberMetaData getMetaDataForExternalMapping(JavaTypeMapping mapping, int mappingType)
getMetaDataForExternalMapping in interface DatastoreClassmapping - The mappingmappingType - The mapping typepublic JavaTypeMapping getMemberMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd)
getMemberMapping in interface DatastoreClassmmd - MetaData for this field/propertypublic JavaTypeMapping getMemberMappingInDatastoreClass(org.datanucleus.metadata.AbstractMemberMetaData mmd)
getMemberMappingInDatastoreClass in interface DatastoreClassmmd - Metadata of the field/propertypublic JavaTypeMapping getMemberMapping(String memberName)
getMemberMapping in interface DatastoreClassmemberName - Name of field/propertyNoSuchPersistentFieldException - Thrown when the field/property is not foundpublic void providePrimaryKeyMappings(MappingConsumer consumer)
providePrimaryKeyMappings in interface DatastoreClassprovidePrimaryKeyMappings in class AbstractClassTableconsumer - Consumer for the mappingspublic final void provideExternalMappings(MappingConsumer consumer, int mappingType)
provideExternalMappings in interface DatastoreClassconsumer - Consumer for the mappingsmappingType - Type of external mappingpublic void provideMappingsForMembers(MappingConsumer consumer, org.datanucleus.metadata.AbstractMemberMetaData[] fieldMetaData, boolean includeSecondaryTables)
provideMappingsForMembers in interface DatastoreClassprovideMappingsForMembers in class AbstractClassTableconsumer - Consumer for the mappingsfieldMetaData - MetaData for the fields to provide mappings forincludeSecondaryTables - Whether to provide fields in secondary tablespublic void provideUnmappedColumns(MappingConsumer consumer)
provideUnmappedColumns in interface DatastoreClassconsumer - Consumer of informationpublic boolean validateConstraints(Connection conn, boolean autoCreate, Collection autoCreateErrors, org.datanucleus.ClassLoaderResolver clr) throws SQLException
validateConstraints in class TableImplconn - Connection to use in validationautoCreate - Whether to auto create the constraintsautoCreateErrors - Whether to log a warning only on errors during "auto create"clr - The ClassLoaderResolverSQLException - Thrown when an error occurs in validationCopyright © 2017. All rights reserved.