org.jpox.store.rdbms.table
Class CollectionTable
java.lang.Object
org.jpox.store.rdbms.table.AbstractTable
org.jpox.store.rdbms.table.TableImpl
org.jpox.store.rdbms.table.JoinTable
org.jpox.store.rdbms.table.ElementContainerTable
org.jpox.store.rdbms.table.CollectionTable
- All Implemented Interfaces:
- org.jpox.store.mapped.DatastoreCollection, org.jpox.store.mapped.DatastoreContainer, org.jpox.store.mapped.DatastoreContainerObject, org.jpox.store.mapped.DatastoreElementContainer, org.jpox.store.mapped.DatastoreObject, SCOTable, Table
public class CollectionTable
- extends ElementContainerTable
- implements org.jpox.store.mapped.DatastoreCollection
Representation of a join table for a Collection. A Collection covers a wide range of possibilities
in terms of whether it allows duplicates or not, whether it allows nulls or not, whether it supports
ordering via indexes, whether it supports ordering via a SELECT criteria, etc. Consequently the
join table can vary depending on the required capabilities.
JoinTable Mappings
The join table consists of the following mappings :-
- ownerMapping linking back to the owning class with the Collection.
- elementMapping either being an FK link to the element table or being an
embedded/serialised element stored wholely in this table.
- orderMapping which may be null, or otherwise stores an index for the elements.
This is either to provide uniqueness or ordering in a List (and part of the PK).
- Version:
- $Revision: 1.39 $
|
Constructor Summary |
CollectionTable(org.jpox.store.mapped.DatastoreIdentifier tableName,
org.jpox.metadata.AbstractMemberMetaData fmd,
RDBMSManager storeMgr)
Constructor. |
|
Method Summary |
java.lang.String |
getElementType()
Accessor for the element type stored in this Collection/Set/List. |
void |
initialize(org.jpox.ClassLoaderResolver clr)
Method to initialise the table definition. |
boolean |
isEmbeddedElement()
Accessor for whether the element is embedded into this table. |
boolean |
isEmbeddedElementPC()
Accessor for whether the element is a PersistenceCapable(embedded). |
boolean |
isSerialisedElement()
Accessor for whether the element is serialised into this table. |
boolean |
isSerialisedElementPC()
Accessor for whether the element is a PersistenceCapable(serialised) |
protected boolean |
requiresPrimaryKey()
Convenience method for whether a PK is required for the join table. |
| Methods inherited from class org.jpox.store.rdbms.table.ElementContainerTable |
applyUserPrimaryKeySpecification, getElementMapping, getExpectedCandidateKeys, getExpectedForeignKeys, getExpectedIndices, getFieldMapping, getForeignKeyToElement, getForeignKeyToOwner, getOrderMapping, getRelationDiscriminatorMapping, getRelationDiscriminatorValue |
| Methods inherited from class org.jpox.store.rdbms.table.TableImpl |
createConstraints, dropConstraints, getSQLAddCandidateKeyStatements, getSQLAddFKStatements, getSQLCreateIndexStatements, getSQLCreateStatements, getSQLDropStatements, initializeColumnInfoForPrimaryKeyColumns, initializeColumnInfoFromDatastore, postInitialize, preInitialize, validate, validateColumns, validateConstraints, validatePrimaryKey |
| Methods inherited from class org.jpox.store.rdbms.table.AbstractTable |
addColumnInternal, addDatastoreField, allowDDLOutput, assertIsInitialized, assertIsInitializedModified, assertIsPKInitialized, assertIsPKUninitialized, assertIsUninitialized, assertIsValidated, create, drop, equals, executeDdlStatement, executeDdlStatementList, exists, getCatalogName, getDatastoreFieldsMetaData, getDatastoreIdentifierFullyQualified, getDiscriminatorMapping, getDiscriminatorMetaData, getIdentifier, getSchemaName, getStoreManager, getVersionMapping, getVersionMetaData, hasColumnName, hasDatastoreField, hashCode, isCompleteDdl, isInitialized, isInitializedModified, isOutputtingDDL, isPKInitialized, isValidated, setCompleteDdl, setDdlWriter, tableExistsInDatastore, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jpox.store.mapped.DatastoreElementContainer |
getElementMapping |
| Methods inherited from interface org.jpox.store.mapped.DatastoreContainer |
getOwnerMapping |
| Methods inherited from interface org.jpox.store.mapped.DatastoreContainerObject |
addDatastoreField, getDatastoreFieldsMetaData, getDiscriminatorMapping, getDiscriminatorMetaData, getFieldMapping, getIDMapping, getVersionMapping, getVersionMetaData, hasDatastoreField |
| Methods inherited from interface org.jpox.store.mapped.DatastoreObject |
getIdentifier, getStoreManager |
| Methods inherited from interface org.jpox.store.rdbms.table.Table |
create, drop, exists, getCatalogName, getSchemaName, isInitialized, isInitializedModified, isValidated, postInitialize, preInitialize, validate |
CollectionTable
public CollectionTable(org.jpox.store.mapped.DatastoreIdentifier tableName,
org.jpox.metadata.AbstractMemberMetaData fmd,
RDBMSManager storeMgr)
- Constructor.
- Parameters:
tableName - Identifier name of the tablefmd - MetaData for the field of the ownerstoreMgr - The Store Manager managing these tables.
initialize
public void initialize(org.jpox.ClassLoaderResolver clr)
- Method to initialise the table definition.
- Specified by:
initialize in interface Table- Overrides:
initialize in class ElementContainerTable
- Parameters:
clr - The ClassLoaderResolver
getElementType
public java.lang.String getElementType()
- Accessor for the element type stored in this Collection/Set/List.
- Specified by:
getElementType in class ElementContainerTable
- Returns:
- Name of element type.
isSerialisedElement
public boolean isSerialisedElement()
- Accessor for whether the element is serialised into this table.
This can be a serialised PersistenceCapable, or a serialised simple type
- Returns:
- Whether the element is serialised.
isEmbeddedElement
public boolean isEmbeddedElement()
- Accessor for whether the element is embedded into this table.
This can be an embedded PersistenceCapable, or an embedded simple type
- Returns:
- Whether the element is embedded.
isSerialisedElementPC
public boolean isSerialisedElementPC()
- Accessor for whether the element is a PersistenceCapable(serialised)
- Returns:
- Whether the element is PC and is serialised
isEmbeddedElementPC
public boolean isEmbeddedElementPC()
- Accessor for whether the element is a PersistenceCapable(embedded).
Currently this only defines a PC element as embedded if the MetaData has an block.
This may or may not be correct depending on how you interpret the JDO2 spec "embedded-element"
flag.
- Returns:
- Whether the element is PC and is embedded
requiresPrimaryKey
protected boolean requiresPrimaryKey()
- Convenience method for whether a PK is required for the join table.
Extends JoinTable allowing for "ordered List" case which do not require a primary key (so we can have duplicates).
- Overrides:
requiresPrimaryKey in class JoinTable
- Returns:
- Whether a PK is required
Copyright © -2008 . All Rights Reserved.