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
public abstract class JoinTable extends TableImpl
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
Fields Modifier and Type Field Description protected org.datanucleus.metadata.AbstractMemberMetaData
mmd
MetaData for the field/property in the owner class.protected JavaTypeMapping
ownerMapping
Mapping of owner column(s) back to the owner table PK.protected Table
ownerTable
Table of the owner of the member represented here.protected String
ownerType
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
Constructors Modifier Constructor Description protected
JoinTable(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 JavaTypeMapping
getIdMapping()
Accessor for a mapping for the ID (persistable) for this table.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.Table
getOwnerTable()
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, 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 Detail
-
ownerTable
protected final Table ownerTable
Table of the owner of the member represented here.
-
mmd
protected final org.datanucleus.metadata.AbstractMemberMetaData mmd
MetaData for the field/property in the owner class.
-
ownerMapping
protected JavaTypeMapping ownerMapping
Mapping of owner column(s) back to the owner table PK.
-
ownerType
protected final String ownerType
Object type of the owner.
-
-
Constructor Detail
-
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 Detail
-
getOwnerTable
public Table getOwnerTable()
-
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 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
public 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 JavaTypeMapping 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.
-
-