|
|||||||||||
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
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, 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 ClassLoaderResolverMethod Detail |
public void preInitialize(ClassLoaderResolver clr)
preInitialize
in interface Table
preInitialize
in class TableImpl
clr
- the ClassLoaderResolverpublic void initialize(ClassLoaderResolver clr)
initialize
in interface Table
clr
- The ClassLoaderResolverpublic void postInitialize(ClassLoaderResolver clr)
postInitialize
in interface Table
postInitialize
in class TableImpl
clr
- the ClassLoaderResolverpublic 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 AbstractClassTable
clr
- The ClassLoaderResolverpublic final java.lang.Object newOID(PersistenceManager pm, javax.jdo.spi.PersistenceCapable pcClass)
newOID
in interface DatastoreClass
pm
- The PersistenceManagerpcClass
- The persistence capable class
public java.lang.String getType()
getType
in interface DatastoreClass
public IdentityType getIdentityType()
getIdentityType
in interface DatastoreClass
getIdentityType
in class AbstractClassTable
public final VersionMetaData getVersionMetaData()
getVersionMetaData
in interface DatastoreContainerObject
getVersionMetaData
in class AbstractTable
public final DiscriminatorMetaData getDiscriminatorMetaData()
getDiscriminatorMetaData
in interface DatastoreContainerObject
getDiscriminatorMetaData
in class AbstractTable
public boolean isObjectIDDatastoreAttributed()
isObjectIDDatastoreAttributed
in interface DatastoreClass
isObjectIDDatastoreAttributed
in class AbstractClassTable
public boolean isBaseDatastoreClass()
isBaseDatastoreClass
in interface DatastoreClass
public ClassTable getSupertable()
public DatastoreClass getBaseDatastoreClassWithField(AbstractPropertyMetaData fmd)
getBaseDatastoreClassWithField
in interface DatastoreClass
fmd
- Field MetaData for this field
protected java.util.Set getExpectedIndices(ClassLoaderResolver clr)
getExpectedIndices
in class TableImpl
clr
- The ClassLoaderResolver
protected java.util.List getExpectedForeignKeys(ClassLoaderResolver clr)
getExpectedForeignKeys
in class TableImpl
clr
- The ClassLoaderResolver
protected ForeignKey getForeignKeyForForeignKeyMetaData(ForeignKeyMetaData fkmd)
fkmd
- ForeignKey MetaData
protected java.util.List getExpectedCandidateKeys()
getExpectedCandidateKeys
in class TableImpl
public PrimaryKey getPrimaryKey()
getPrimaryKey
in class TableImpl
protected java.util.List getSQLCreateStatements(java.util.Properties props)
getSQLCreateStatements
in class TableImpl
props
- Properties for creating the table
protected java.util.List getSQLDropStatements()
getSQLDropStatements
in class TableImpl
public JavaTypeMapping getIDMapping()
getIDMapping
in interface DatastoreContainerObject
public JavaTypeMapping getExternalOrderMapping(AbstractPropertyMetaData fmd)
getExternalOrderMapping
in interface DatastoreClass
fmd
- The metadata for the List field.
public java.util.HashMap getExternalFkMappings()
public JavaTypeMapping getExternalFkMapping(AbstractPropertyMetaData fmd)
getExternalFkMapping
in interface DatastoreClass
fmd
- The metadata for the field.
public java.util.HashMap getExternalFkDiscriminatorMappings()
public JavaTypeMapping getExternalFkDiscriminatorMapping(AbstractPropertyMetaData fmd)
getExternalFkDiscriminatorMapping
in interface DatastoreClass
fmd
- The metadata for the field.
public JavaTypeMapping getFieldMapping(AbstractPropertyMetaData fmd)
getFieldMapping
in interface DatastoreClass
fmd
- Field MetaData for this field
public JavaTypeMapping getFieldMapping(java.lang.String fieldName)
getFieldMapping
in interface DatastoreClass
fieldName
- Name of field
NoSuchPersistentFieldException
- Thrown when the field is not foundpublic AbstractPropertyMetaData getFieldMetaData(java.lang.String fieldName)
getFieldMetaData
in interface DatastoreClass
fieldName
- the field name
public void insert(StateManager sm)
insert
in interface DatastoreClass
sm
- StateManager for the object to insert.public void fetch(StateManager sm, AbstractPropertyMetaData[] fieldMetaData)
fetch
in interface DatastoreClass
sm
- StateManager for the object to fetch.fieldMetaData
- MetaDat afor the fields to be fetchedpublic void update(StateManager sm, AbstractPropertyMetaData[] fieldMetaData)
update
in interface DatastoreClass
sm
- StateManager for the object to update.fieldMetaData
- MetaData for the fields to be updatedpublic void delete(StateManager sm)
delete
in interface DatastoreClass
sm
- StateManager for the object to delete.public void locate(StateManager sm)
locate
in interface DatastoreClass
sm
- The StateManager for the object to be found
javax.jdo.JDOObjectNotFoundException
- If the instance does not exist in
the datastorepublic void deleteDependent(StateManager sm, AbstractPropertyMetaData[] fieldMetaData)
deleteDependent
in interface DatastoreClass
sm
- StateManager for the object being deleted.fieldMetaData
- MetaData for the fields to delete.public void providePrimaryKeyMappings(MappingConsumer consumer)
providePrimaryKeyMappings
in interface DatastoreClass
providePrimaryKeyMappings
in class AbstractClassTable
consumer
- Consumer for the mappingspublic final void provideExternalFkMappings(MappingConsumer consumer)
provideExternalFkMappings
in interface DatastoreClass
consumer
- Consumer for the mappingspublic final void provideExternalOrderMappings(MappingConsumer consumer)
provideExternalOrderMappings
in interface DatastoreClass
consumer
- Consumer for the mappingspublic void provideMappingsForFields(MappingConsumer consumer, AbstractPropertyMetaData[] fieldMetaData, boolean includeSecondaryTables)
provideMappingsForFields
in interface DatastoreClass
provideMappingsForFields
in class AbstractClassTable
consumer
- Consumer for the mappingsfieldMetaData
- MetaData for the fields to provide mappings forincludeSecondaryTables
- Whether to provide fields in secondary tablespublic boolean validateConstraints(java.sql.Connection conn, boolean autoCreate, java.util.Collection autoCreateErrors, ClassLoaderResolver clr) throws java.sql.SQLException
validateConstraints
in class TableImpl
conn
- 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 |