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
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
FieldsModifier and TypeFieldDescriptionprotected TableTable of the owner of this member.protected JavaTypeMappingMapping from the join table to the "related".Fields inherited from class JoinTable
mmd, ownerMapping, ownerTypeFields inherited from class 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
ConstructorsConstructorDescriptionPersistableJoinTable(Table ownerTable, DatastoreIdentifier tableName, org.datanucleus.metadata.AbstractMemberMetaData mmd, RDBMSStoreManager storeMgr) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected List<CandidateKey> Accessor for the candidate keys for this table.getExpectedForeignKeys(org.datanucleus.ClassLoaderResolver clr) Accessor for the expected foreign keys for this table.getExpectedIndices(org.datanucleus.ClassLoaderResolver clr) Accessor for the indices for this table.getMemberMapping(org.datanucleus.metadata.AbstractMemberMetaData mmd) Accessor for the mapping for the specified FieldMetaData.Accessor for the mapping of the "related" in the join table.voidinitialize(org.datanucleus.ClassLoaderResolver clr) Method to initialise the table.Methods inherited from class JoinTable
getIdMapping, getOwnerMapping, getOwnerMemberMetaData, getOwnerTable, getPrimaryKey, requiresPrimaryKeyMethods inherited from class TableImpl
createConstraints, dropConstraints, getSQLAddCandidateKeyStatements, getSQLAddFKStatements, getSQLCreateIndexStatements, getSQLCreateStatements, getSQLDropStatements, initializeColumnInfoForPrimaryKeyColumns, initializeColumnInfoFromDatastore, logMapping, validate, validateColumns, validateConstraints, validatePrimaryKeyMethods inherited from class 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 Details
-
ownerTable
Table of the owner of this member.
-
-
Constructor Details
-
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 Details
-
getMemberMapping
Description copied from interface:TableAccessor 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:TableMethod to initialise the table.- Parameters:
clr- The ClassLoaderResolver
-
getExpectedForeignKeys
Accessor for the expected foreign keys for this table.- Overrides:
getExpectedForeignKeysin classTableImpl- Parameters:
clr- The ClassLoaderResolver- Returns:
- The expected foreign keys.
-
getExpectedIndices
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:
getExpectedIndicesin classTableImpl- Parameters:
clr- The ClassLoaderResolver- Returns:
- The indices
-
getExpectedCandidateKeys
Accessor for the candidate keys for this table.- Overrides:
getExpectedCandidateKeysin classTableImpl- Returns:
- The indices
-
getRelatedMapping
Accessor for the mapping of the "related" in the join table.- Returns:
- The column mapping for the related side.
-