org.jpox.store.rdbms.table
Class JoinTable

java.lang.Object
  extended byorg.jpox.store.rdbms.table.AbstractTable
      extended byorg.jpox.store.rdbms.table.TableImpl
          extended byorg.jpox.store.rdbms.table.JoinTable
All Implemented Interfaces:
DatastoreContainerObject, DatastoreObject, Table
Direct Known Subclasses:
ElementContainerTable, MapTable

public abstract class JoinTable
extends TableImpl
implements DatastoreContainerObject

Abstract class representing a field that maps to a table in the datastore. This will be something like an SCO, such as Set, Map, List where a link table is used. It could potentially be used where the user wants to map some field into its own SCO table.

Version:
$Revision: 1.11 $

Field Summary
protected  AbstractPropertyMetaData fmd
          FieldMetaData for the field in the owner class.
protected  JavaTypeMapping ownerMapping
          Mapping of an owner (OID) column back to the owner table PK
protected  java.lang.String ownerType
          Object type of the owner.
 
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
protected JoinTable(DatastoreIdentifier tableName, AbstractPropertyMetaData fmd, RDBMSManager storeMgr)
          Constructor.
 
Method Summary
 JavaTypeMapping getIDMapping()
          Accessor for a mapping for the ID (PersistenceCapable) for this table.
 AbstractPropertyMetaData getOwnerFieldMetaData()
          Accessor for the MetaData for the owner field for this container.
 JavaTypeMapping getOwnerMapping()
          Accessor for the "owner" mapping end of the relationship.
 PrimaryKey getPrimaryKey()
          Accessor for the primary key for this table.
protected  boolean requiresPrimaryKey()
          Convenience method for whether a PK is required for the join table.
 
Methods inherited from class org.jpox.store.rdbms.table.TableImpl
dropConstraints, getExpectedCandidateKeys, getExpectedForeignKeys, getExpectedIndices, 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, allowDdlDump, assertIsInitialized, assertIsInitializedModified, assertIsPKInitialized, assertIsPKUninitialized, assertIsUninitialized, assertIsValidated, create, drop, equals, executeDdlStatement, executeDdlStatementList, exists, getCatalogName, getDatastoreIdentifierFullyQualified, getDiscriminatorMapping, getDiscriminatorMetaData, getIdentifier, getSchemaName, getStoreManager, getVersionMapping, getVersionMetaData, hasColumnName, hasDatastoreField, hashCode, isDumpingDdl, isInitialized, isInitializedModified, isPKInitialized, isValidated, setDdlDumpWriter, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jpox.store.DatastoreContainerObject
addDatastoreField, getDiscriminatorMapping, getDiscriminatorMetaData, getFieldMapping, getVersionMapping, getVersionMetaData, hasDatastoreField
 
Methods inherited from interface org.jpox.store.DatastoreObject
getIdentifier, getStoreManager
 
Methods inherited from interface org.jpox.store.rdbms.table.Table
initialize
 

Field Detail

fmd

protected final AbstractPropertyMetaData fmd
FieldMetaData for the field in the owner class.


ownerMapping

protected JavaTypeMapping ownerMapping
Mapping of an owner (OID) column back to the owner table PK


ownerType

protected final java.lang.String ownerType
Object type of the owner.

Constructor Detail

JoinTable

protected JoinTable(DatastoreIdentifier tableName,
                    AbstractPropertyMetaData fmd,
                    RDBMSManager storeMgr)
Constructor.

Parameters:
tableName - The Table SQL identifier
fmd - Field meta data for the owner field
storeMgr - Manager for the datastore.
Method Detail

getPrimaryKey

public PrimaryKey getPrimaryKey()
Accessor for the primary key for this table. Overrides the method in TableImpl to add on any specification of PK name in the <join> metadata.

Overrides:
getPrimaryKey in class TableImpl
Returns:
The primary key.

requiresPrimaryKey

protected boolean requiresPrimaryKey()
Convenience method for whether a PK is required for the join table. Makes use of the JPOX extension "primary-key" (within <join>) to allow turning off PK generation.

Returns:
Whether a PK is required

getOwnerMapping

public JavaTypeMapping getOwnerMapping()
Accessor for the "owner" mapping end of the relationship. This will be the primary key of the owner table.

Returns:
The column mapping for the owner.

getOwnerFieldMetaData

public AbstractPropertyMetaData getOwnerFieldMetaData()
Accessor for the MetaData for the owner field for this container.

Returns:
The FieldMetaData

getIDMapping

public JavaTypeMapping getIDMapping()
Accessor for a mapping for the ID (PersistenceCapable) for this table. This is not supported by join tables since they don't represent FCOs.

Specified by:
getIDMapping in interface DatastoreContainerObject
Returns:
The (PersistenceCapable) ID mapping.


Copyright © -2007 . All Rights Reserved.