Class PersistableJoinTable
- java.lang.Object
-
- org.datanucleus.store.rdbms.table.AbstractTable
-
- org.datanucleus.store.rdbms.table.TableImpl
-
- org.datanucleus.store.rdbms.table.JoinTable
-
- org.datanucleus.store.rdbms.table.PersistableJoinTable
-
- All Implemented Interfaces:
Table
,org.datanucleus.store.schema.table.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
Fields Modifier and Type Field Description protected Table
ownerTable
Table of the owner of this member.protected 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, columnsByIdentifier, dba, existsInDatastore, identifier, state, storeMgr, TABLE_STATE_INITIALIZED, TABLE_STATE_INITIALIZED_MODIFIED, TABLE_STATE_NEW, TABLE_STATE_PK_INITIALIZED, TABLE_STATE_VALIDATED
-
-
Constructor Summary
Constructors Constructor Description PersistableJoinTable(Table ownerTable, DatastoreIdentifier tableName, org.datanucleus.metadata.AbstractMemberMetaData mmd, RDBMSStoreManager storeMgr)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<CandidateKey>
getExpectedCandidateKeys()
Accessor for the candidate keys for this table.List<ForeignKey>
getExpectedForeignKeys(org.datanucleus.ClassLoaderResolver clr)
Accessor for the expected foreign keys for this table.protected Set<Index>
getExpectedIndices(org.datanucleus.ClassLoaderResolver clr)
Accessor for the indices for this table.JavaTypeMapping
getMemberMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Accessor for the mapping for the specified FieldMetaData.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
getIdMapping, getOwnerMapping, getOwnerMemberMetaData, getOwnerTable, getPrimaryKey, requiresPrimaryKey
-
Methods inherited from class org.datanucleus.store.rdbms.table.TableImpl
createConstraints, dropConstraints, getSQLAddCandidateKeyStatements, getSQLAddFKStatements, getSQLCreateIndexStatements, getSQLCreateStatements, getSQLDropStatements, initializeColumnInfoForPrimaryKeyColumns, initializeColumnInfoFromDatastore, logMapping, validate, validateColumns, validateConstraints, validatePrimaryKey
-
Methods inherited from class org.datanucleus.store.rdbms.table.AbstractTable
addColumn, addColumnInternal, allowDDLOutput, assertIsInitialized, assertIsInitializedModified, assertIsPKInitialized, assertIsPKUninitialized, assertIsUninitialized, assertIsValidated, create, drop, equals, executeDdlStatement, executeDdlStatementList, exists, getCatalogName, getClassMetaData, getColumn, getColumnForName, getColumnForPosition, getColumns, getDatastoreIdentifierFullyQualified, getDiscriminatorMetaData, getIdentifier, getMemberColumnMappingForEmbeddedMember, getMemberColumnMappingForMember, getMemberColumnMappings, getName, getNumberOfColumns, getSchemaName, getStoreManager, getSurrogateColumn, getSurrogateMapping, getVersionMetaData, hasColumn, hasColumnName, hashCode, isInitialized, isInitializedModified, isPKInitialized, isValidated, postInitialize, preInitialize, tableExistsInDatastore, toString
-
-
-
-
Field Detail
-
ownerTable
protected Table ownerTable
Table of the owner of this member.
-
relatedMapping
protected JavaTypeMapping relatedMapping
Mapping from the join table to the "related". This will be a PersistableMapping.
-
-
Constructor Detail
-
PersistableJoinTable
public PersistableJoinTable(Table ownerTable, DatastoreIdentifier tableName, org.datanucleus.metadata.AbstractMemberMetaData mmd, RDBMSStoreManager storeMgr)
Constructor.- Parameters:
ownerTable
- Table of the owner of this member.tableName
- The Table SQL identifiermmd
- Member meta data for the "element" member.storeMgr
- Manager for the datastore.
-
-
Method Detail
-
getMemberMapping
public JavaTypeMapping getMemberMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Description copied from interface:Table
Accessor for the mapping for the specified FieldMetaData. A datastore container object may store many fields.- Parameters:
mmd
- Metadata for the field/property- Returns:
- The Mapping for the member, or null if the FieldMetaData cannot be found
-
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<ForeignKey> getExpectedForeignKeys(org.datanucleus.ClassLoaderResolver clr)
Accessor for the expected foreign keys for this table.- Overrides:
getExpectedForeignKeys
in classTableImpl
- Parameters:
clr
- The ClassLoaderResolver- Returns:
- The expected foreign keys.
-
getExpectedIndices
protected Set<Index> 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 classTableImpl
- Parameters:
clr
- The ClassLoaderResolver- Returns:
- The indices
-
getExpectedCandidateKeys
protected List<CandidateKey> getExpectedCandidateKeys()
Accessor for the candidate keys for this table.- Overrides:
getExpectedCandidateKeys
in classTableImpl
- Returns:
- The indices
-
getRelatedMapping
public JavaTypeMapping getRelatedMapping()
Accessor for the mapping of the "related" in the join table.- Returns:
- The column mapping for the related side.
-
-