|
||||||||||
| 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
public abstract class AbstractClassTable
Abstract representation of a table for a class. Abstracts out the common parts of a primary ClassTable and a SecondaryClassTable.
| Field Summary | |
|---|---|
protected JavaTypeMapping |
datastoreIDMapping
Mapping for datastore identity (optional). |
protected JavaTypeMapping |
discriminatorMapping
Mapping for any discriminator column. |
protected java.util.Map |
fieldMappingsMap
Mappings for fields mapped to this table, keyed by the FieldMetaData. |
protected int |
highestFieldNumber
Highest absolute field number managed by this table |
protected JavaTypeMapping |
idMapping
Mapping for the id of the table. |
protected JavaTypeMapping[] |
pkMappings
Mappings for application identity (optional). |
protected JavaTypeMapping |
versionMapping
Mapping for any version/timestamp column. |
| 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 | |
|---|---|
AbstractClassTable(DatastoreIdentifier tableName,
RDBMSManager storeMgr)
Constructor. |
|
| Method Summary | |
|---|---|
protected void |
addFieldMapping(JavaTypeMapping fieldMapping)
Utility to add the mapping for a field to the managed list. |
JavaTypeMapping |
getDataStoreObjectIdMapping()
Accessor for a mapping for the datastore ID (OID) for this table. |
protected DatastoreIdentifier |
getDefaultNameForType(java.lang.String className,
ClassLoaderResolver clr)
Accessor for the column name for the specified class. |
JavaTypeMapping |
getDiscriminatorMapping()
Accessor for the discriminator mapping specified . |
abstract IdentityType |
getIdentityType()
Accessor for the identity-type. |
DatastoreContainerObject |
getPrimaryDatastoreContainerObject()
Convenience method to return the primary table. |
JavaTypeMapping |
getVersionMapping()
Accessor for the version mapping specified . |
protected abstract void |
initializePK(ClassLoaderResolver clr)
Method to initialise the table primary key field(s). |
abstract boolean |
isObjectIDDatastoreAttributed()
Accessor for whether the table has its identity attributed by the datastore (e.g using autoincrement) |
boolean |
managesField(java.lang.String fieldName)
Convenience method for whether the (fully-specified) field is managed by this table |
void |
provideDatastoreIdMappings(MappingConsumer consumer)
Accessor for a mapping for the datastore ID (OID) for this table. |
void |
provideDiscriminatorMappings(MappingConsumer consumer)
Provide the mappings to discriminator mappings |
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 |
provideNonPrimaryKeyMappings(MappingConsumer consumer)
Provide the mappings to the consumer for all non primary-key fields mapped to this table. |
abstract void |
providePrimaryKeyMappings(MappingConsumer consumer)
Provide the mappings to the consumer for all primary-key fields mapped to this table (for application identity). |
void |
provideVersionMappings(MappingConsumer consumer)
Provide the mappings to version mappings |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jpox.store.rdbms.table.Table |
|---|
initialize |
| Methods inherited from interface org.jpox.store.DatastoreContainerObject |
|---|
getFieldMapping, getIDMapping |
| Field Detail |
|---|
protected java.util.Map fieldMappingsMap
protected JavaTypeMapping datastoreIDMapping
protected JavaTypeMapping[] pkMappings
protected JavaTypeMapping idMapping
protected JavaTypeMapping versionMapping
protected JavaTypeMapping discriminatorMapping
protected int highestFieldNumber
| Constructor Detail |
|---|
public AbstractClassTable(DatastoreIdentifier tableName,
RDBMSManager storeMgr)
tableName - Name of the tablestoreMgr - Store Manager that is managing this instance| Method Detail |
|---|
public DatastoreContainerObject getPrimaryDatastoreContainerObject()
protected abstract void initializePK(ClassLoaderResolver clr)
clr - The ClassLoaderResolverpublic boolean managesField(java.lang.String fieldName)
fieldName - Fully qualified name of the field
protected void addFieldMapping(JavaTypeMapping fieldMapping)
fieldMapping - The mapping for the fieldpublic abstract IdentityType getIdentityType()
public abstract boolean isObjectIDDatastoreAttributed()
protected DatastoreIdentifier getDefaultNameForType(java.lang.String className,
ClassLoaderResolver clr)
className - Name of the class for which the column is required.clr - The ClassLoaderResolver
public JavaTypeMapping getDataStoreObjectIdMapping()
public JavaTypeMapping getVersionMapping()
getVersionMapping in interface DatastoreContainerObjectgetVersionMapping in class AbstractTablepublic JavaTypeMapping getDiscriminatorMapping()
getDiscriminatorMapping in interface DatastoreContainerObjectgetDiscriminatorMapping in class AbstractTablepublic final void provideDatastoreIdMappings(MappingConsumer consumer)
consumer - Consumer for the mappingspublic abstract void providePrimaryKeyMappings(MappingConsumer consumer)
consumer - Consumer for the mappingspublic final void provideNonPrimaryKeyMappings(MappingConsumer consumer)
consumer - Consumer for the mappings
public void provideMappingsForFields(MappingConsumer consumer,
AbstractPropertyMetaData[] fieldMetaData,
boolean includeSecondaryTables)
consumer - Consumer for the mappingsfieldMetaData - MetaData for the fields to provide mappings forincludeSecondaryTables - Whether to provide fields in secondary tablespublic final void provideVersionMappings(MappingConsumer consumer)
consumer - Consumer for the version mappingspublic final void provideDiscriminatorMappings(MappingConsumer consumer)
consumer - Consumer for the mappings
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||