org.datanucleus.store.rdbms.table
Class JoinTable

java.lang.Object
  extended by org.datanucleus.store.rdbms.table.AbstractTable
      extended by org.datanucleus.store.rdbms.table.TableImpl
          extended by org.datanucleus.store.rdbms.table.JoinTable
All Implemented Interfaces:
org.datanucleus.store.mapped.DatastoreContainerObject, Table
Direct Known Subclasses:
ElementContainerTable, MapTable

public abstract class JoinTable
extends TableImpl
implements org.datanucleus.store.mapped.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.


Field Summary
protected  org.datanucleus.metadata.AbstractMemberMetaData mmd
          MetaData for the field/property in the owner class.
protected  org.datanucleus.store.mapped.mapping.JavaTypeMapping ownerMapping
          Mapping of owner column(s) back to the owner table PK.
protected  java.lang.String ownerType
          Object type of the owner.
 
Fields inherited from class org.datanucleus.store.rdbms.table.AbstractTable
columns, columnsByName, dba, existsInDatastore, identifier, LOCALISER, state, storeMgr
 
Constructor Summary
protected JoinTable(org.datanucleus.store.mapped.DatastoreIdentifier tableName, org.datanucleus.metadata.AbstractMemberMetaData mmd, RDBMSManager storeMgr)
          Constructor.
 
Method Summary
protected  void debugMapping(org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping)
          Convenience logging method to output the mapping information for an element, key, value field
 org.datanucleus.store.mapped.mapping.JavaTypeMapping getIDMapping()
          Accessor for a mapping for the ID (PersistenceCapable) for this table.
 org.datanucleus.store.mapped.mapping.JavaTypeMapping getOwnerMapping()
          Accessor for the "owner" mapping end of the relationship.
 org.datanucleus.metadata.AbstractMemberMetaData getOwnerMemberMetaData()
          Accessor for the MetaData for the owner field/property for this container.
 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.datanucleus.store.rdbms.table.TableImpl
createConstraints, dropConstraints, getExpectedCandidateKeys, getExpectedForeignKeys, getExpectedIndices, getSQLAddCandidateKeyStatements, getSQLAddFKStatements, getSQLCreateIndexStatements, getSQLCreateStatements, getSQLDropStatements, initializeColumnInfoForPrimaryKeyColumns, initializeColumnInfoFromDatastore, postInitialize, preInitialize, validate, validateColumns, validateConstraints, validatePrimaryKey
 
Methods inherited from class org.datanucleus.store.rdbms.table.AbstractTable
addColumnInternal, addDatastoreField, allowDDLOutput, assertIsInitialized, assertIsInitializedModified, assertIsPKInitialized, assertIsPKUninitialized, assertIsUninitialized, assertIsValidated, create, drop, equals, executeDdlStatement, executeDdlStatementList, exists, getCatalogName, getDatastoreField, getDatastoreFields, getDatastoreIdentifierFullyQualified, getDiscriminatorMapping, getDiscriminatorMetaData, getIdentifier, getSchemaName, getStoreManager, getVersionMapping, getVersionMetaData, hasColumnName, hasDatastoreField, hashCode, isInitialized, isInitializedModified, isPKInitialized, isValidated, tableExistsInDatastore, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.datanucleus.store.mapped.DatastoreContainerObject
addDatastoreField, getDatastoreField, getDatastoreFields, getDiscriminatorMapping, getDiscriminatorMetaData, getIdentifier, getMemberMapping, getStoreManager, getVersionMapping, getVersionMetaData, hasDatastoreField
 
Methods inherited from interface org.datanucleus.store.rdbms.table.Table
initialize
 

Field Detail

mmd

protected final org.datanucleus.metadata.AbstractMemberMetaData mmd
MetaData for the field/property in the owner class.


ownerMapping

protected org.datanucleus.store.mapped.mapping.JavaTypeMapping ownerMapping
Mapping of owner column(s) back to the owner table PK.


ownerType

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

Constructor Detail

JoinTable

protected JoinTable(org.datanucleus.store.mapped.DatastoreIdentifier tableName,
                    org.datanucleus.metadata.AbstractMemberMetaData mmd,
                    RDBMSManager storeMgr)
Constructor.

Parameters:
tableName - The Table SQL identifier
mmd - Field meta data for the owner field/property
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 extension "primary-key" (within <join>) to allow turning off PK generation.

Returns:
Whether a PK is required

getOwnerMapping

public org.datanucleus.store.mapped.mapping.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.

getOwnerMemberMetaData

public org.datanucleus.metadata.AbstractMemberMetaData getOwnerMemberMetaData()
Accessor for the MetaData for the owner field/property for this container.

Returns:
metadata for the owning field/property

getIDMapping

public org.datanucleus.store.mapped.mapping.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 org.datanucleus.store.mapped.DatastoreContainerObject
Returns:
The (PersistenceCapable) ID mapping.

debugMapping

protected void debugMapping(org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping)
Convenience logging method to output the mapping information for an element, key, value field

Parameters:
mapping - The mapping


Copyright © 2009. All Rights Reserved.