|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.rdbms.table.AbstractTable
org.datanucleus.store.rdbms.table.TableImpl
org.datanucleus.store.rdbms.table.AbstractClassTable
org.datanucleus.store.rdbms.table.ClassTable
public class ClassTable
Table representing a Java class (or classes) as a first class object (FCO). Uses the inheritance strategy to control whether this represents multiple classes or just the one class.
| Field Summary | |
|---|---|
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. |
| Fields inherited from class org.datanucleus.store.rdbms.table.AbstractClassTable |
|---|
datastoreIDMapping, discriminatorMapping, discriminatorMetaData, highestMemberNumber, idMapping, memberMappingsMap, pkMappings, tenantMapping, versionMapping, versionMetaData |
| Fields inherited from class org.datanucleus.store.rdbms.table.AbstractTable |
|---|
columns, columnsByName, dba, existsInDatastore, identifier, LOCALISER, state, storeMgr, TABLE_STATE_INITIALIZED, TABLE_STATE_INITIALIZED_MODIFIED, TABLE_STATE_NEW, TABLE_STATE_PK_INITIALIZED, TABLE_STATE_VALIDATED |
| Constructor Summary | |
|---|---|
ClassTable(org.datanucleus.store.mapped.DatastoreIdentifier tableName,
RDBMSStoreManager storeMgr,
org.datanucleus.metadata.ClassMetaData cmd)
Constructor. |
|
| Method Summary | |
|---|---|
org.datanucleus.store.mapped.DatastoreClass |
getBaseDatastoreClass()
|
org.datanucleus.store.mapped.DatastoreClass |
getBaseDatastoreClassWithMember(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Convenience accessor for the base table for this table which has the specified field. |
org.datanucleus.store.mapped.mapping.JavaTypeMapping |
getDiscriminatorMapping(boolean allowSuperclasses)
Accessor for the discriminator mapping specified . |
org.datanucleus.metadata.DiscriminatorMetaData |
getDiscriminatorMetaData()
Accessor for Discriminator MetaData |
protected List |
getExpectedCandidateKeys()
Accessor for the expected candidate keys for this table. |
List |
getExpectedForeignKeys(org.datanucleus.ClassLoaderResolver clr)
Accessor for the expected foreign keys for this table. |
protected Set |
getExpectedIndices(org.datanucleus.ClassLoaderResolver clr)
Accessor for the indices for this table. |
org.datanucleus.store.mapped.mapping.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. |
org.datanucleus.store.mapped.mapping.JavaTypeMapping |
getIdMapping()
Accessor for a mapping for the ID (PersistenceCapable) for this table. |
String[] |
getManagedClasses()
Accessor for the names of all classes managed by this table. |
org.datanucleus.store.mapped.mapping.JavaTypeMapping |
getMemberMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Accessor for the field mapping for the specified field. |
org.datanucleus.store.mapped.mapping.JavaTypeMapping |
getMemberMapping(String memberName)
Accessor for the field mapping for the named field. |
org.datanucleus.store.mapped.mapping.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(org.datanucleus.store.mapped.mapping.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. |
org.datanucleus.store.mapped.DatastoreClass |
getSuperDatastoreClass()
Accessor for the supertable for this table. |
ClassTable |
getTableManagingMapping(org.datanucleus.store.mapped.mapping.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. |
org.datanucleus.store.mapped.mapping.JavaTypeMapping |
getVersionMapping(boolean allowSuperclasses)
Accessor for the version mapping specified . |
org.datanucleus.metadata.VersionMetaData |
getVersionMetaData()
Accessor for versionMetaData |
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(org.datanucleus.store.mapped.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(org.datanucleus.store.mapped.mapping.MappingConsumer consumer,
int mappingType)
Provide the mappings to the consumer for all external fields mapped to this table of the specified type |
void |
provideMappingsForMembers(org.datanucleus.store.mapped.mapping.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(org.datanucleus.store.mapped.mapping.MappingConsumer consumer)
Provide the mappings to the consumer for all primary-key fields mapped to this table. |
void |
provideUnmappedDatastoreFields(org.datanucleus.store.mapped.mapping.MappingConsumer consumer)
Method to provide all unmapped datastore fields (columns) to the consumer. |
boolean |
validateConstraints(Connection conn,
boolean autoCreate,
Collection autoCreateErrors,
org.datanucleus.ClassLoaderResolver clr)
Method to validate the constraints of this table. |
| Methods inherited from class org.datanucleus.store.rdbms.table.AbstractClassTable |
|---|
addMemberMapping, addMultitenancyMapping, getDatastoreObjectIdMapping, getMappingForMemberName, getMultitenancyMapping, getPrimaryDatastoreContainerObject, managesMapping, managesMember, provideDatastoreIdMappings, provideDiscriminatorMappings, provideMultitenancyMapping, provideNonPrimaryKeyMappings, provideVersionMappings |
| Methods inherited from class org.datanucleus.store.rdbms.table.TableImpl |
|---|
createConstraints, dropConstraints, getSQLAddCandidateKeyStatements, getSQLAddFKStatements, getSQLCreateIndexStatements, initializeColumnInfoForPrimaryKeyColumns, initializeColumnInfoFromDatastore, validate, validateColumns, validatePrimaryKey |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.datanucleus.store.mapped.DatastoreClass |
|---|
getDatastoreObjectIdMapping, managesMapping, provideDatastoreIdMappings, provideDiscriminatorMappings, provideMultitenancyMapping, provideNonPrimaryKeyMappings, provideVersionMappings, toString |
| Methods inherited from interface org.datanucleus.store.mapped.DatastoreContainerObject |
|---|
addDatastoreField, getDatastoreField, getDatastoreFields, getIdentifier, getMultitenancyMapping, getStoreManager, hasDatastoreField |
| Field Detail |
|---|
protected transient String managingClassCurrent
protected boolean runCallbacksAfterManageClass
| Constructor Detail |
|---|
public ClassTable(org.datanucleus.store.mapped.DatastoreIdentifier tableName,
RDBMSStoreManager storeMgr,
org.datanucleus.metadata.ClassMetaData cmd)
tableName - Table name SQL identifierstoreMgr - Store Manager to manage this tablecmd - MetaData for the class.| Method Detail |
|---|
public void preInitialize(org.datanucleus.ClassLoaderResolver clr)
preInitialize in interface TablepreInitialize in class TableImplclr - the ClassLoaderResolverpublic void initialize(org.datanucleus.ClassLoaderResolver clr)
initialize in interface Tableclr - The ClassLoaderResolverpublic void postInitialize(org.datanucleus.ClassLoaderResolver clr)
postInitialize in interface TablepostInitialize in class TableImplclr - the ClassLoaderResolver
public 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 org.datanucleus.store.mapped.DatastoreClasspublic boolean managesClass(String className)
managesClass in interface org.datanucleus.store.mapped.DatastoreClassclassName - Name of the class
protected void initializePK(org.datanucleus.ClassLoaderResolver clr)
initializePK in class AbstractClassTableclr - The ClassLoaderResolverpublic String getType()
getType in interface org.datanucleus.store.mapped.DatastoreClasspublic org.datanucleus.metadata.IdentityType getIdentityType()
getIdentityType in interface org.datanucleus.store.mapped.DatastoreClassgetIdentityType in class AbstractClassTablepublic final org.datanucleus.metadata.VersionMetaData getVersionMetaData()
getVersionMetaData in interface org.datanucleus.store.mapped.DatastoreContainerObjectgetVersionMetaData in class AbstractTablepublic final org.datanucleus.metadata.DiscriminatorMetaData getDiscriminatorMetaData()
getDiscriminatorMetaData in interface org.datanucleus.store.mapped.DatastoreContainerObjectgetDiscriminatorMetaData in class AbstractTablepublic final ClassTable getTableWithDiscriminator()
public boolean isObjectIdDatastoreAttributed()
isObjectIdDatastoreAttributed in interface org.datanucleus.store.mapped.DatastoreClassisObjectIdDatastoreAttributed in class AbstractClassTablepublic boolean isBaseDatastoreClass()
isBaseDatastoreClass in interface org.datanucleus.store.mapped.DatastoreClasspublic org.datanucleus.store.mapped.DatastoreClass getBaseDatastoreClass()
getBaseDatastoreClass in interface org.datanucleus.store.mapped.DatastoreClasspublic org.datanucleus.store.mapped.DatastoreClass getSuperDatastoreClass()
getSuperDatastoreClass in interface org.datanucleus.store.mapped.DatastoreClasspublic boolean isSuperDatastoreClass(org.datanucleus.store.mapped.DatastoreClass table)
isSuperDatastoreClass in interface org.datanucleus.store.mapped.DatastoreClasstable - The DatastoreClass to check
public Collection getSecondaryDatastoreClasses()
getSecondaryDatastoreClasses in interface org.datanucleus.store.mapped.DatastoreClasspublic org.datanucleus.store.mapped.mapping.JavaTypeMapping getVersionMapping(boolean allowSuperclasses)
getVersionMapping in interface org.datanucleus.store.mapped.DatastoreContainerObjectgetVersionMapping 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 has
public org.datanucleus.store.mapped.mapping.JavaTypeMapping getDiscriminatorMapping(boolean allowSuperclasses)
getDiscriminatorMapping in interface org.datanucleus.store.mapped.DatastoreContainerObjectgetDiscriminatorMapping 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 has
public ClassTable getTableManagingMapping(org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping)
public org.datanucleus.store.mapped.DatastoreClass getBaseDatastoreClassWithMember(org.datanucleus.metadata.AbstractMemberMetaData mmd)
getBaseDatastoreClassWithMember in interface org.datanucleus.store.mapped.DatastoreClassmmd - Field MetaData for this field
protected Set getExpectedIndices(org.datanucleus.ClassLoaderResolver clr)
getExpectedIndices in class TableImplclr - The ClassLoaderResolver
public List getExpectedForeignKeys(org.datanucleus.ClassLoaderResolver clr)
getExpectedForeignKeys in class TableImplclr - The ClassLoaderResolver
protected List getExpectedCandidateKeys()
getExpectedCandidateKeys in class TableImplpublic PrimaryKey getPrimaryKey()
getPrimaryKey in class TableImplprotected List getSQLCreateStatements(Properties props)
getSQLCreateStatements in class TableImplprops - Properties for creating the table
protected List getSQLDropStatements()
getSQLDropStatements in class TableImplpublic org.datanucleus.store.mapped.mapping.JavaTypeMapping getIdMapping()
getIdMapping in interface org.datanucleus.store.mapped.DatastoreContainerObject
public org.datanucleus.store.mapped.mapping.JavaTypeMapping getExternalMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd,
int mappingType)
getExternalMapping in interface org.datanucleus.store.mapped.DatastoreClassmmd - MetaData for the field/propertymappingType - Type of mapping
public org.datanucleus.metadata.AbstractMemberMetaData getMetaDataForExternalMapping(org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping,
int mappingType)
getMetaDataForExternalMapping in interface org.datanucleus.store.mapped.DatastoreClassmapping - The mappingmappingType - The mapping type
public org.datanucleus.store.mapped.mapping.JavaTypeMapping getMemberMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd)
getMemberMapping in interface org.datanucleus.store.mapped.DatastoreClassgetMemberMapping in interface org.datanucleus.store.mapped.DatastoreContainerObjectmmd - MetaData for this field/property
public org.datanucleus.store.mapped.mapping.JavaTypeMapping getMemberMappingInDatastoreClass(org.datanucleus.metadata.AbstractMemberMetaData mmd)
getMemberMappingInDatastoreClass in interface org.datanucleus.store.mapped.DatastoreClassmmd - Metadata of the field/property
public org.datanucleus.store.mapped.mapping.JavaTypeMapping getMemberMapping(String memberName)
getMemberMapping in interface org.datanucleus.store.mapped.DatastoreClassmemberName - Name of field/property
org.datanucleus.store.exceptions.NoSuchPersistentFieldException - Thrown when the field/property is not foundpublic void providePrimaryKeyMappings(org.datanucleus.store.mapped.mapping.MappingConsumer consumer)
providePrimaryKeyMappings in interface org.datanucleus.store.mapped.DatastoreClassprovidePrimaryKeyMappings in class AbstractClassTableconsumer - Consumer for the mappings
public final void provideExternalMappings(org.datanucleus.store.mapped.mapping.MappingConsumer consumer,
int mappingType)
provideExternalMappings in interface org.datanucleus.store.mapped.DatastoreClassconsumer - Consumer for the mappingsmappingType - Type of external mapping
public void provideMappingsForMembers(org.datanucleus.store.mapped.mapping.MappingConsumer consumer,
org.datanucleus.metadata.AbstractMemberMetaData[] fieldMetaData,
boolean includeSecondaryTables)
provideMappingsForMembers in interface org.datanucleus.store.mapped.DatastoreClassprovideMappingsForMembers in class AbstractClassTableconsumer - Consumer for the mappingsfieldMetaData - MetaData for the fields to provide mappings forincludeSecondaryTables - Whether to provide fields in secondary tablespublic void provideUnmappedDatastoreFields(org.datanucleus.store.mapped.mapping.MappingConsumer consumer)
provideUnmappedDatastoreFields in interface org.datanucleus.store.mapped.DatastoreClassconsumer - Consumer of information
public 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 ClassLoaderResolver
SQLException - Thrown when an error occurs in validation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||