Class JoinTable
java.lang.Object
org.datanucleus.store.rdbms.table.AbstractTable
org.datanucleus.store.rdbms.table.TableImpl
org.datanucleus.store.rdbms.table.JoinTable
- All Implemented Interfaces:
Table
,org.datanucleus.store.schema.table.Table
- Direct Known Subclasses:
ElementContainerTable
,MapTable
,PersistableJoinTable
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
FieldsModifier and TypeFieldDescriptionprotected final org.datanucleus.metadata.AbstractMemberMetaData
MetaData for the field/property in the owner class.protected JavaTypeMapping
Mapping of owner column(s) back to the owner table PK.protected final Table
Table of the owner of the member represented here.protected final String
Object type of the owner.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
ConstructorsModifierConstructorDescriptionprotected
JoinTable
(Table ownerTable, DatastoreIdentifier tableName, org.datanucleus.metadata.AbstractMemberMetaData mmd, RDBMSStoreManager storeMgr) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionAccessor for a mapping for the ID (persistable) for this table.Accessor for the "owner" mapping end of the relationship.org.datanucleus.metadata.AbstractMemberMetaData
Accessor for the MetaData for the owner field/property for this container.Accessor for the primary key for this table.protected boolean
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, 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
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.datanucleus.store.rdbms.table.Table
getMemberMapping, initialize
-
Field Details
-
ownerTable
Table of the owner of the member represented here. -
mmd
protected final org.datanucleus.metadata.AbstractMemberMetaData mmdMetaData for the field/property in the owner class. -
ownerMapping
Mapping of owner column(s) back to the owner table PK. -
ownerType
Object type of the owner.
-
-
Constructor Details
-
JoinTable
protected JoinTable(Table ownerTable, DatastoreIdentifier tableName, org.datanucleus.metadata.AbstractMemberMetaData mmd, RDBMSStoreManager storeMgr) Constructor.- Parameters:
ownerTable
- Table of the owner member, for linking backtableName
- The Table SQL identifiermmd
- Member meta data for the owner field/propertystoreMgr
- Manager for the datastore.
-
-
Method Details
-
getOwnerTable
-
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 classTableImpl
- 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 <field> or <join>) to allow turning off PK generation.- Returns:
- Whether a PK is required
-
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
Accessor for a mapping for the ID (persistable) for this table. This is not supported by join tables since they don't represent FCOs.- Returns:
- The (persistable) ID mapping.
-