|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jpox.store.rdbms.table.AbstractTable
org.jpox.store.rdbms.table.TableImpl
org.jpox.store.rdbms.table.AbstractClassTable
org.jpox.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 java.lang.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.jpox.store.rdbms.table.AbstractClassTable |
|---|
datastoreIDMapping, discriminatorMapping, discriminatorMetaData, fieldMappingsMap, highestFieldNumber, idMapping, pkMappings, versionMapping, versionMetaData |
| Fields inherited from class org.jpox.store.rdbms.table.AbstractTable |
|---|
columns, columnsByName, completeDdl, dba, ddlWriter, existsInDatastore, identifier, LOCALISER, state, storeMgr |
| Fields inherited from interface org.jpox.store.rdbms.table.Table |
|---|
TABLE_STATE_INITIALIZED, TABLE_STATE_INITIALIZED_MODIFIED, TABLE_STATE_NEW, TABLE_STATE_PK_INITIALIZED, TABLE_STATE_VALIDATED, TABLE_TYPE_MISSING, TABLE_TYPE_TABLE, TABLE_TYPE_UNKNOWN, TABLE_TYPE_VIEW |
| Constructor Summary | |
|---|---|
ClassTable(org.jpox.store.mapped.DatastoreIdentifier tableName,
RDBMSManager storeMgr,
org.jpox.metadata.ClassMetaData cmd)
Constructor. |
|
| Method Summary | |
|---|---|
org.jpox.store.mapped.DatastoreClass |
getBaseDatastoreClassWithField(org.jpox.metadata.AbstractMemberMetaData fmd)
Convenience accessor for the base table for this table which has the specified field. |
org.jpox.store.mapped.mapping.JavaTypeMapping |
getDiscriminatorMapping(boolean allowSuperclasses)
Accessor for the discriminator mapping specified . |
org.jpox.metadata.DiscriminatorMetaData |
getDiscriminatorMetaData()
Accessor for Discriminator MetaData |
protected java.util.List |
getExpectedCandidateKeys()
Accessor for the expected candidate keys for this table. |
protected java.util.List |
getExpectedForeignKeys(org.jpox.ClassLoaderResolver clr)
Accessor for the expected foreign keys for this table. |
protected java.util.Set |
getExpectedIndices(org.jpox.ClassLoaderResolver clr)
Accessor for the indices for this table. |
org.jpox.store.mapped.mapping.JavaTypeMapping |
getExternalMapping(org.jpox.metadata.AbstractMemberMetaData fmd,
int mappingType)
Accessor for an external mapping for the specified field of the required type. |
org.jpox.store.mapped.mapping.JavaTypeMapping |
getFieldMapping(org.jpox.metadata.AbstractMemberMetaData fmd)
Accessor for the field mapping for the specified field. |
org.jpox.store.mapped.mapping.JavaTypeMapping |
getFieldMapping(java.lang.String fieldName)
Accessor for the field mapping for the named field. |
org.jpox.store.mapped.mapping.JavaTypeMapping |
getFieldMappingInDatastoreClass(org.jpox.metadata.AbstractMemberMetaData mmd)
Accessor for the mapping for the specified field only in this datastore class. |
org.jpox.metadata.IdentityType |
getIdentityType()
Accessor for the identity-type. |
org.jpox.store.mapped.mapping.JavaTypeMapping |
getIDMapping()
Accessor for a mapping for the ID (PersistenceCapable) for this table. |
java.lang.String[] |
getManagedClasses()
Accessor for the names of all classes managed by this table. |
org.jpox.metadata.AbstractMemberMetaData |
getMetaDataForExternalMapping(org.jpox.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. |
java.util.Collection |
getSecondaryDatastoreClasses()
Accessor for any secondary tables for this table. |
protected java.util.List |
getSQLCreateStatements(java.util.Properties props)
Accessor for the CREATE statements for this table. |
protected java.util.List |
getSQLDropStatements()
Accessor for the DROP statements for this table. |
org.jpox.store.mapped.DatastoreClass |
getSuperDatastoreClass()
Accessor for the supertable for this table. |
ClassTable |
getTableWithDiscriminator()
Convenience method to return the root table with a discriminator in this inheritance tree. |
java.lang.String |
getType()
Accessor for the main class represented. |
org.jpox.store.mapped.mapping.JavaTypeMapping |
getVersionMapping(boolean allowSuperclasses)
Accessor for the version mapping specified . |
org.jpox.metadata.VersionMetaData |
getVersionMetaData()
Accessor for versionMetaData |
void |
initialize(org.jpox.ClassLoaderResolver clr)
Method to initialise the table. |
protected void |
initializePK(org.jpox.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 |
void |
manageClass(org.jpox.metadata.AbstractClassMetaData theCmd,
org.jpox.ClassLoaderResolver clr)
Method that adds the specified class to be managed by this table. |
boolean |
managesClass(java.lang.String className)
Accessor for whether this table manages the specified class |
void |
postInitialize(org.jpox.ClassLoaderResolver clr)
Post initilize. |
void |
preInitialize(org.jpox.ClassLoaderResolver clr)
Pre-initialize. |
void |
provideExternalMappings(org.jpox.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 |
provideMappingsForFields(org.jpox.store.mapped.mapping.MappingConsumer consumer,
org.jpox.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.jpox.store.mapped.mapping.MappingConsumer consumer)
Provide the mappings to the consumer for all primary-key fields mapped to this table. |
void |
provideUnmappedDatastoreFields(org.jpox.store.mapped.mapping.MappingConsumer consumer)
Method to provide all unmapped datastore fields (columns) to the consumer. |
boolean |
validateConstraints(java.sql.Connection conn,
boolean autoCreate,
java.util.Collection autoCreateErrors,
org.jpox.ClassLoaderResolver clr)
Method to validate the constraints of this table. |
| Methods inherited from class org.jpox.store.rdbms.table.AbstractClassTable |
|---|
addFieldMapping, getDataStoreObjectIdMapping, getMappingForFieldName, getPrimaryDatastoreContainerObject, managesField, provideDatastoreIdMappings, provideDiscriminatorMappings, provideNonPrimaryKeyMappings, provideVersionMappings |
| Methods inherited from class org.jpox.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.jpox.store.mapped.DatastoreClass |
|---|
getDataStoreObjectIdMapping, provideDatastoreIdMappings, provideDiscriminatorMappings, provideNonPrimaryKeyMappings, provideVersionMappings, toString |
| Methods inherited from interface org.jpox.store.mapped.DatastoreContainerObject |
|---|
addDatastoreField, getDatastoreFieldsMetaData, hasDatastoreField |
| Methods inherited from interface org.jpox.store.mapped.DatastoreObject |
|---|
getIdentifier, getStoreManager |
| Field Detail |
|---|
protected transient java.lang.String managingClassCurrent
protected boolean runCallbacksAfterManageClass
| Constructor Detail |
|---|
public ClassTable(org.jpox.store.mapped.DatastoreIdentifier tableName,
RDBMSManager storeMgr,
org.jpox.metadata.ClassMetaData cmd)
tableName - Table name SQL identifierstoreMgr - Store Manager to manage this tablecmd - MetaData for the class.| Method Detail |
|---|
public void preInitialize(org.jpox.ClassLoaderResolver clr)
preInitialize in interface TablepreInitialize in class TableImplclr - the ClassLoaderResolverpublic void initialize(org.jpox.ClassLoaderResolver clr)
initialize in interface Tableclr - The ClassLoaderResolverpublic void postInitialize(org.jpox.ClassLoaderResolver clr)
postInitialize in interface TablepostInitialize in class TableImplclr - the ClassLoaderResolver
public void manageClass(org.jpox.metadata.AbstractClassMetaData theCmd,
org.jpox.ClassLoaderResolver clr)
theCmd - ClassMetaData for the class to be managedclr - The ClassLoaderResolverpublic java.lang.String[] getManagedClasses()
public boolean managesClass(java.lang.String className)
managesClass in interface org.jpox.store.mapped.DatastoreClassclassName - Name of the class
protected void initializePK(org.jpox.ClassLoaderResolver clr)
initializePK in class AbstractClassTableclr - The ClassLoaderResolverpublic java.lang.String getType()
getType in interface org.jpox.store.mapped.DatastoreClasspublic org.jpox.metadata.IdentityType getIdentityType()
getIdentityType in interface org.jpox.store.mapped.DatastoreClassgetIdentityType in class AbstractClassTablepublic final org.jpox.metadata.VersionMetaData getVersionMetaData()
getVersionMetaData in interface org.jpox.store.mapped.DatastoreContainerObjectgetVersionMetaData in class AbstractTablepublic final org.jpox.metadata.DiscriminatorMetaData getDiscriminatorMetaData()
getDiscriminatorMetaData in interface org.jpox.store.mapped.DatastoreContainerObjectgetDiscriminatorMetaData in class AbstractTablepublic final ClassTable getTableWithDiscriminator()
public boolean isObjectIDDatastoreAttributed()
isObjectIDDatastoreAttributed in interface org.jpox.store.mapped.DatastoreClassisObjectIDDatastoreAttributed in class AbstractClassTablepublic boolean isBaseDatastoreClass()
isBaseDatastoreClass in interface org.jpox.store.mapped.DatastoreClasspublic org.jpox.store.mapped.DatastoreClass getSuperDatastoreClass()
getSuperDatastoreClass in interface org.jpox.store.mapped.DatastoreClasspublic java.util.Collection getSecondaryDatastoreClasses()
getSecondaryDatastoreClasses in interface org.jpox.store.mapped.DatastoreClasspublic org.jpox.store.mapped.mapping.JavaTypeMapping getVersionMapping(boolean allowSuperclasses)
getVersionMapping in interface org.jpox.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.jpox.store.mapped.mapping.JavaTypeMapping getDiscriminatorMapping(boolean allowSuperclasses)
getDiscriminatorMapping in interface org.jpox.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 org.jpox.store.mapped.DatastoreClass getBaseDatastoreClassWithField(org.jpox.metadata.AbstractMemberMetaData fmd)
getBaseDatastoreClassWithField in interface org.jpox.store.mapped.DatastoreClassfmd - Field MetaData for this field
protected java.util.Set getExpectedIndices(org.jpox.ClassLoaderResolver clr)
getExpectedIndices in class TableImplclr - The ClassLoaderResolver
protected java.util.List getExpectedForeignKeys(org.jpox.ClassLoaderResolver clr)
getExpectedForeignKeys in class TableImplclr - The ClassLoaderResolver
protected java.util.List getExpectedCandidateKeys()
getExpectedCandidateKeys in class TableImplpublic PrimaryKey getPrimaryKey()
getPrimaryKey in class TableImplprotected java.util.List getSQLCreateStatements(java.util.Properties props)
getSQLCreateStatements in class TableImplprops - Properties for creating the table
protected java.util.List getSQLDropStatements()
getSQLDropStatements in class TableImplpublic org.jpox.store.mapped.mapping.JavaTypeMapping getIDMapping()
getIDMapping in interface org.jpox.store.mapped.DatastoreContainerObject
public org.jpox.store.mapped.mapping.JavaTypeMapping getExternalMapping(org.jpox.metadata.AbstractMemberMetaData fmd,
int mappingType)
getExternalMapping in interface org.jpox.store.mapped.DatastoreClassfmd - MetaData for the fieldmappingType - Type of mapping
public org.jpox.metadata.AbstractMemberMetaData getMetaDataForExternalMapping(org.jpox.store.mapped.mapping.JavaTypeMapping mapping,
int mappingType)
getMetaDataForExternalMapping in interface org.jpox.store.mapped.DatastoreClassmapping - The mappingmappingType - The mapping type
public org.jpox.store.mapped.mapping.JavaTypeMapping getFieldMapping(org.jpox.metadata.AbstractMemberMetaData fmd)
getFieldMapping in interface org.jpox.store.mapped.DatastoreClassgetFieldMapping in interface org.jpox.store.mapped.DatastoreContainerObjectfmd - Field MetaData for this field
public org.jpox.store.mapped.mapping.JavaTypeMapping getFieldMappingInDatastoreClass(org.jpox.metadata.AbstractMemberMetaData mmd)
getFieldMappingInDatastoreClass in interface org.jpox.store.mapped.DatastoreClassmmd - Metadata of the field/property
public org.jpox.store.mapped.mapping.JavaTypeMapping getFieldMapping(java.lang.String fieldName)
getFieldMapping in interface org.jpox.store.mapped.DatastoreClassfieldName - Name of field
org.jpox.store.exceptions.NoSuchPersistentFieldException - Thrown when the field is not foundpublic void providePrimaryKeyMappings(org.jpox.store.mapped.mapping.MappingConsumer consumer)
providePrimaryKeyMappings in interface org.jpox.store.mapped.DatastoreClassprovidePrimaryKeyMappings in class AbstractClassTableconsumer - Consumer for the mappings
public final void provideExternalMappings(org.jpox.store.mapped.mapping.MappingConsumer consumer,
int mappingType)
provideExternalMappings in interface org.jpox.store.mapped.DatastoreClassconsumer - Consumer for the mappingsmappingType - Type of external mapping
public void provideMappingsForFields(org.jpox.store.mapped.mapping.MappingConsumer consumer,
org.jpox.metadata.AbstractMemberMetaData[] fieldMetaData,
boolean includeSecondaryTables)
provideMappingsForFields in interface org.jpox.store.mapped.DatastoreClassprovideMappingsForFields 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.jpox.store.mapped.mapping.MappingConsumer consumer)
provideUnmappedDatastoreFields in interface org.jpox.store.mapped.DatastoreClassconsumer - Consumer of information
public boolean validateConstraints(java.sql.Connection conn,
boolean autoCreate,
java.util.Collection autoCreateErrors,
org.jpox.ClassLoaderResolver clr)
throws java.sql.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
java.sql.SQLException - Thrown when an error occurs in validation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||