org.datanucleus.store.rdbms.table
Class PersistableJoinTable

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
              extended by org.datanucleus.store.rdbms.table.PersistableJoinTable
All Implemented Interfaces:
org.datanucleus.store.mapped.DatastoreContainerObject, Table

public class PersistableJoinTable
extends JoinTable

Representation of a join table for the case where we have an N-1 unidirectional relation stored in a join table. It's a minority interest situation, but worth inclusion. The "owner" in this case is the side with the relation (the "N" side). The "related" is the other side.


Field Summary
protected  org.datanucleus.store.mapped.mapping.JavaTypeMapping relatedMapping
          Mapping from the join table to the "related".
 
Fields inherited from class org.datanucleus.store.rdbms.table.JoinTable
mmd, ownerMapping, ownerType
 
Fields inherited from class org.datanucleus.store.rdbms.table.AbstractTable
columns, columnsByName, dba, existsInDatastore, identifier, LOCALISER, state, storeMgr, TABLE_STATE_INITIALIZED, TABLE_STATE_INITIALIZED_MODIFIED, TABLE_STATE_NEW, TABLE_STATE_PK_INITIALIZED, TABLE_STATE_VALIDATED
 
Constructor Summary
PersistableJoinTable(org.datanucleus.store.mapped.DatastoreIdentifier tableName, org.datanucleus.metadata.AbstractMemberMetaData mmd, RDBMSStoreManager storeMgr)
          Constructor.
 
Method Summary
protected  List getExpectedCandidateKeys()
          Accessor for the candidate keys for this table.
 List getExpectedForeignKeys(org.datanucleus.ClassLoaderResolver clr)
          Accessor for the expected foreign keys for this table.
protected  Set getExpectedIndices(org.datanucleus.ClassLoaderResolver clr)
          Accessor for the indices for this table.
 org.datanucleus.store.mapped.mapping.JavaTypeMapping getMemberMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd)
           
 org.datanucleus.store.mapped.mapping.JavaTypeMapping getRelatedMapping()
          Accessor for the mapping of the "related" in the join table.
 void initialize(org.datanucleus.ClassLoaderResolver clr)
          Method to initialise the table.
 
Methods inherited from class org.datanucleus.store.rdbms.table.JoinTable
debugMapping, getIdMapping, getOwnerMapping, getOwnerMemberMetaData, getPrimaryKey, requiresPrimaryKey
 
Methods inherited from class org.datanucleus.store.rdbms.table.TableImpl
createConstraints, dropConstraints, 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, getMultitenancyMapping, 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, getMultitenancyMapping, getStoreManager, getVersionMapping, getVersionMetaData, hasDatastoreField
 

Field Detail

relatedMapping

protected org.datanucleus.store.mapped.mapping.JavaTypeMapping relatedMapping
Mapping from the join table to the "related". This will be a PersistableMapping.

Constructor Detail

PersistableJoinTable

public PersistableJoinTable(org.datanucleus.store.mapped.DatastoreIdentifier tableName,
                            org.datanucleus.metadata.AbstractMemberMetaData mmd,
                            RDBMSStoreManager storeMgr)
Constructor.

Parameters:
tableName - The Table SQL identifier
mmd - Member meta data for the "element" field/property
storeMgr - Manager for the datastore.
Method Detail

getMemberMapping

public org.datanucleus.store.mapped.mapping.JavaTypeMapping getMemberMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd)

initialize

public void initialize(org.datanucleus.ClassLoaderResolver clr)
Description copied from interface: Table
Method to initialise the table.

Parameters:
clr - The ClassLoaderResolver

getExpectedForeignKeys

public List getExpectedForeignKeys(org.datanucleus.ClassLoaderResolver clr)
Accessor for the expected foreign keys for this table.

Overrides:
getExpectedForeignKeys in class TableImpl
Parameters:
clr - The ClassLoaderResolver
Returns:
The expected foreign keys.

getExpectedIndices

protected Set getExpectedIndices(org.datanucleus.ClassLoaderResolver clr)
Accessor for the indices for this table. This includes both the user-defined indices (via MetaData), and the ones required by foreign keys (required by relationships).

Overrides:
getExpectedIndices in class TableImpl
Parameters:
clr - The ClassLoaderResolver
Returns:
The indices

getExpectedCandidateKeys

protected List getExpectedCandidateKeys()
Accessor for the candidate keys for this table.

Overrides:
getExpectedCandidateKeys in class TableImpl
Returns:
The indices

getRelatedMapping

public org.datanucleus.store.mapped.mapping.JavaTypeMapping getRelatedMapping()
Accessor for the mapping of the "related" in the join table.

Returns:
The column mapping for the related side.


Copyright © 2012. All Rights Reserved.