|
||||||||||
| 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 |
|---|
| Fields inherited from class org.jpox.store.rdbms.table.AbstractClassTable |
|---|
datastoreIDMapping, discriminatorMapping, fieldMappingsMap, highestFieldNumber, idMapping, pkMappings, versionMapping |
| Fields inherited from class org.jpox.store.rdbms.table.AbstractTable |
|---|
columns, columnsByName, dba, ddlDumpWriter, 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(DatastoreIdentifier tableName,
ClassMetaData cmd,
RDBMSManager storeMgr,
ClassLoaderResolver clr)
Constructor. |
|
| Method Summary | |
|---|---|
void |
delete(StateManager sm)
Method to delete an object from this table. |
void |
deleteDependent(StateManager sm,
AbstractPropertyMetaData[] fieldMetaData)
Delete dependent objects of a persistent object. |
void |
fetch(StateManager sm,
AbstractPropertyMetaData[] fieldMetaData)
Method to fetch an object in this table. |
DatastoreClass |
getBaseDatastoreClassWithField(AbstractPropertyMetaData fmd)
Convenience accessor for the base table for this table which has the specified field. |
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(ClassLoaderResolver clr)
Accessor for the expected foreign keys for this table. |
protected java.util.Set |
getExpectedIndices(ClassLoaderResolver clr)
Accessor for the indices for this table. |
JavaTypeMapping |
getExternalFkDiscriminatorMapping(AbstractPropertyMetaData fmd)
Accessor for the external FK discriminator mapping for an owner field. |
java.util.HashMap |
getExternalFkDiscriminatorMappings()
Accessor for all of the external FK discriminator mappings. |
JavaTypeMapping |
getExternalFkMapping(AbstractPropertyMetaData fmd)
Accessor for the external FK mapping for an owner field. |
java.util.HashMap |
getExternalFkMappings()
Accessor for all of the external FK mappings. |
JavaTypeMapping |
getExternalOrderMapping(AbstractPropertyMetaData fmd)
Accessor for the index mapping specified by the field. |
JavaTypeMapping |
getFieldMapping(AbstractPropertyMetaData fmd)
Accessor for the field mapping for the specified field. |
JavaTypeMapping |
getFieldMapping(java.lang.String fieldName)
Accessor for the field mapping for the named field. |
AbstractPropertyMetaData |
getFieldMetaData(java.lang.String fieldName)
Acessor for the FieldMetaData for the field with the specified name. |
protected ForeignKey |
getForeignKeyForForeignKeyMetaData(ForeignKeyMetaData fkmd)
Convenience method to create a FK for the specified ForeignKeyMetaData. |
IdentityType |
getIdentityType()
Accessor for the identity-type. |
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. |
PrimaryKey |
getPrimaryKey()
Accessor for the primary key 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. |
ClassTable |
getSupertable()
Accessor for the supertable for this table. |
java.lang.String |
getType()
Accessor for the main class represented. |
VersionMetaData |
getVersionMetaData()
Accessor for versionMetaData |
void |
initialize(ClassLoaderResolver clr)
Method to initialise the table. |
protected void |
initializePK(ClassLoaderResolver clr)
Method to initialise the table primary key field(s). |
void |
insert(StateManager sm)
Method to fetch an insert into this table. |
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 |
locate(StateManager sm)
Locates this object in the datastore. |
void |
manageClass(AbstractClassMetaData theCmd,
ClassLoaderResolver clr)
Method to give management of the persistence of the fields of the specified class to this table. |
boolean |
managesClass(java.lang.String className)
Accessor for whether this table manages the specified class |
java.lang.Object |
newOID(PersistenceManager pm,
javax.jdo.spi.PersistenceCapable pcClass)
Create a newOID for a class. |
void |
postInitialize(ClassLoaderResolver clr)
Post initilize. |
void |
preInitialize(ClassLoaderResolver clr)
Pre-initialize. |
void |
provideExternalFkMappings(MappingConsumer consumer)
Provide the mappings to the consumer for all foreign-key fields mapped to this table. |
void |
provideExternalOrderMappings(MappingConsumer consumer)
Provide the mappings to the consumer for all external order fields mapped to this table. |
void |
provideMappingsForFields(MappingConsumer consumer,
AbstractPropertyMetaData[] 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 |
update(StateManager sm,
AbstractPropertyMetaData[] fieldMetaData)
Method to update an object in this table. |
boolean |
validateConstraints(java.sql.Connection conn,
boolean autoCreate,
java.util.Collection autoCreateErrors,
ClassLoaderResolver clr)
Method to validate the constraints of this table. |
| Methods inherited from class org.jpox.store.rdbms.table.AbstractClassTable |
|---|
addFieldMapping, getDataStoreObjectIdMapping, getDefaultNameForType, getDiscriminatorMapping, getPrimaryDatastoreContainerObject, getVersionMapping, managesField, provideDatastoreIdMappings, provideDiscriminatorMappings, provideNonPrimaryKeyMappings, provideVersionMappings |
| Methods inherited from class org.jpox.store.rdbms.table.TableImpl |
|---|
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.DatastoreClass |
|---|
getDataStoreObjectIdMapping, provideDatastoreIdMappings, provideDiscriminatorMappings, provideNonPrimaryKeyMappings, provideVersionMappings, toString |
| Methods inherited from interface org.jpox.store.DatastoreContainerObject |
|---|
addDatastoreField, getDiscriminatorMapping, getVersionMapping, hasDatastoreField |
| Methods inherited from interface org.jpox.store.DatastoreObject |
|---|
getIdentifier, getStoreManager |
| Constructor Detail |
|---|
public ClassTable(DatastoreIdentifier tableName,
ClassMetaData cmd,
RDBMSManager storeMgr,
ClassLoaderResolver clr)
tableName - Table name SQL identifiercmd - MetaData for the class.storeMgr - Store Manager to manage this tableclr - The ClassLoaderResolver| Method Detail |
|---|
public void preInitialize(ClassLoaderResolver clr)
preInitialize in interface TablepreInitialize in class TableImplclr - the ClassLoaderResolverpublic void initialize(ClassLoaderResolver clr)
initialize in interface Tableclr - The ClassLoaderResolverpublic void postInitialize(ClassLoaderResolver clr)
postInitialize in interface TablepostInitialize in class TableImplclr - the ClassLoaderResolver
public void manageClass(AbstractClassMetaData theCmd,
ClassLoaderResolver clr)
theCmd - ClassMetaData for the class to be managedclr - The ClassLoaderResolverpublic java.lang.String[] getManagedClasses()
public boolean managesClass(java.lang.String className)
className - Name of the class
protected void initializePK(ClassLoaderResolver clr)
initializePK in class AbstractClassTableclr - The ClassLoaderResolver
public final java.lang.Object newOID(PersistenceManager pm,
javax.jdo.spi.PersistenceCapable pcClass)
newOID in interface DatastoreClasspm - The PersistenceManagerpcClass - The persistence capable class
public java.lang.String getType()
getType in interface DatastoreClasspublic IdentityType getIdentityType()
getIdentityType in interface DatastoreClassgetIdentityType in class AbstractClassTablepublic final VersionMetaData getVersionMetaData()
getVersionMetaData in interface DatastoreContainerObjectgetVersionMetaData in class AbstractTablepublic final DiscriminatorMetaData getDiscriminatorMetaData()
getDiscriminatorMetaData in interface DatastoreContainerObjectgetDiscriminatorMetaData in class AbstractTablepublic boolean isObjectIDDatastoreAttributed()
isObjectIDDatastoreAttributed in interface DatastoreClassisObjectIDDatastoreAttributed in class AbstractClassTablepublic boolean isBaseDatastoreClass()
isBaseDatastoreClass in interface DatastoreClasspublic ClassTable getSupertable()
public DatastoreClass getBaseDatastoreClassWithField(AbstractPropertyMetaData fmd)
getBaseDatastoreClassWithField in interface DatastoreClassfmd - Field MetaData for this field
protected java.util.Set getExpectedIndices(ClassLoaderResolver clr)
getExpectedIndices in class TableImplclr - The ClassLoaderResolver
protected java.util.List getExpectedForeignKeys(ClassLoaderResolver clr)
getExpectedForeignKeys in class TableImplclr - The ClassLoaderResolver
protected ForeignKey getForeignKeyForForeignKeyMetaData(ForeignKeyMetaData fkmd)
fkmd - ForeignKey MetaData
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 JavaTypeMapping getIDMapping()
getIDMapping in interface DatastoreContainerObjectpublic JavaTypeMapping getExternalOrderMapping(AbstractPropertyMetaData fmd)
getExternalOrderMapping in interface DatastoreClassfmd - The metadata for the List field.
public java.util.HashMap getExternalFkMappings()
public JavaTypeMapping getExternalFkMapping(AbstractPropertyMetaData fmd)
getExternalFkMapping in interface DatastoreClassfmd - The metadata for the field.
public java.util.HashMap getExternalFkDiscriminatorMappings()
public JavaTypeMapping getExternalFkDiscriminatorMapping(AbstractPropertyMetaData fmd)
getExternalFkDiscriminatorMapping in interface DatastoreClassfmd - The metadata for the field.
public JavaTypeMapping getFieldMapping(AbstractPropertyMetaData fmd)
getFieldMapping in interface DatastoreClassgetFieldMapping in interface DatastoreContainerObjectfmd - Field MetaData for this field
public JavaTypeMapping getFieldMapping(java.lang.String fieldName)
getFieldMapping in interface DatastoreClassfieldName - Name of field
NoSuchPersistentFieldException - Thrown when the field is not foundpublic AbstractPropertyMetaData getFieldMetaData(java.lang.String fieldName)
getFieldMetaData in interface DatastoreClassfieldName - the field name
public void insert(StateManager sm)
insert in interface DatastoreClasssm - StateManager for the object to insert.
public void fetch(StateManager sm,
AbstractPropertyMetaData[] fieldMetaData)
fetch in interface DatastoreClasssm - StateManager for the object to fetch.fieldMetaData - MetaDat afor the fields to be fetched
public void update(StateManager sm,
AbstractPropertyMetaData[] fieldMetaData)
update in interface DatastoreClasssm - StateManager for the object to update.fieldMetaData - MetaData for the fields to be updatedpublic void delete(StateManager sm)
delete in interface DatastoreClasssm - StateManager for the object to delete.public void locate(StateManager sm)
locate in interface DatastoreClasssm - The StateManager for the object to be found
javax.jdo.JDOObjectNotFoundException - If the instance does not exist in
the datastore
public void deleteDependent(StateManager sm,
AbstractPropertyMetaData[] fieldMetaData)
deleteDependent in interface DatastoreClasssm - StateManager for the object being deleted.fieldMetaData - MetaData for the fields to delete.public void providePrimaryKeyMappings(MappingConsumer consumer)
providePrimaryKeyMappings in interface DatastoreClassprovidePrimaryKeyMappings in class AbstractClassTableconsumer - Consumer for the mappingspublic final void provideExternalFkMappings(MappingConsumer consumer)
provideExternalFkMappings in interface DatastoreClassconsumer - Consumer for the mappingspublic final void provideExternalOrderMappings(MappingConsumer consumer)
provideExternalOrderMappings in interface DatastoreClassconsumer - Consumer for the mappings
public void provideMappingsForFields(MappingConsumer consumer,
AbstractPropertyMetaData[] fieldMetaData,
boolean includeSecondaryTables)
provideMappingsForFields in interface DatastoreClassprovideMappingsForFields in class AbstractClassTableconsumer - Consumer for the mappingsfieldMetaData - MetaData for the fields to provide mappings forincludeSecondaryTables - Whether to provide fields in secondary tables
public boolean validateConstraints(java.sql.Connection conn,
boolean autoCreate,
java.util.Collection autoCreateErrors,
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 | |||||||||