Purpose: Many to many mappings are used to represent the relationships between a collection of source objects and a collection of target objects. The mapping requires the creation of an intermediate table for managing the associations between the source and target records.
| Modifier and Type | Field and Description |
|---|---|
| protected HistoryPolicy | |
| protected boolean | isDefinedAsOneToManyMapping
266912: Since: EclipseLink 2.0 for the Metamodel API For 1:1 and m:m mappings - track the original externally defined mapping if different Note: This field will provide differentiation for the following external to internal representations for mapping types - A OneToManyMapping will be represented by a ManyToManyMapping if unidirectional - A ManyToOneMapping will be represented by a OneToOneMapping (without a FK constraint) |
| protected RelationTableMechanism | mechanism
Mechanism holds relationTable and all fields and queries associated with it. |
| protected static final String | |
| protected static final String | |
| protected static final String | PostInsert
Used for data modification events. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addSourceRelationKeyField(DatabaseField sourceRelationKeyField, DatabaseField sourcePrimaryKeyField)
PUBLIC: Add the fields in the intermediate table that corresponds to the primary key in the source table. |
| public void | addSourceRelationKeyFieldName(String sourceRelationKeyFieldName, String sourcePrimaryKeyFieldName)
PUBLIC: Add the fields in the intermediate table that corresponds to the primary key in the source table. |
| public void | addTargetRelationKeyField(DatabaseField targetRelationKeyField, DatabaseField targetPrimaryKeyField)
PUBLIC: Add the fields in the intermediate table that corresponds to the primary key in the target table. |
| public void | addTargetRelationKeyFieldName(String targetRelationKeyFieldName, String targetPrimaryKeyFieldName)
PUBLIC: Add the fields in the intermediate table that corresponds to the primary key in the target table. |
| protected Expression | buildBatchCriteria(ExpressionBuilder builder, ObjectLevelReadQuery query)
Overrides org. |
| protected void | buildListOrderField()
Overrides org. |
| public Object | clone()
Overrides org. Implements org. |
| public void | collectQueryParameters(Set<DatabaseField>
TODO cacheFields)Overrides org. |
| public Object | createMapComponentFromRow(AbstractRecord dbRow, ObjectBuildingQuery query, CacheKey parentCacheKey, AbstractSession session, boolean isTargetProtected)
Implements org. |
| public void | earlyPreDelete(DeleteObjectQuery
TODO query, Object TODO object)Overrides org. |
| public void | extendPessimisticLockScopeInSourceQuery(ObjectLevelReadQuery sourceQuery)
Overrides org. |
| protected void | extendPessimisticLockScopeInTargetQuery(ObjectLevelReadQuery targetQuery, ObjectBuildingQuery sourceQuery)
Overrides org. |
| protected Object | extractBatchKeyFromRow(AbstractRecord row, AbstractSession session)
Overrides org. |
| protected Object | extractKeyFromTargetRow(AbstractRecord row, AbstractSession session)
Overrides org. |
| protected Expression | getAdditionalFieldsBaseExpression(ReadQuery query)
Overrides org. |
| protected DataModifyQuery | |
| protected ReadQuery | getExtendPessimisticLockScopeDedicatedQuery(AbstractSession session, short lockMode)
Overrides org. |
| public Collection | getFieldsForTranslationInAggregate()
Overrides org. |
| public HistoryPolicy | |
| protected DataModifyQuery | |
| public Expression | getJoinCriteria(ObjectExpression context, Expression base)
Overrides org. |
| public DatabaseTable | |
| public RelationTableMechanism | |
| public String | |
| public String | getRelationTableQualifiedName()
PUBLIC: Return the relation table qualified name associated with the mapping. |
| public Vector | |
| public Vector | |
| public Vector | getSourceRelationKeyFieldNames()
PUBLIC: Return the source relation key field names associated with the mapping. |
| public Vector | getSourceRelationKeyFields()
INTERNAL: Return all the source relation key fields associated with the mapping. |
| public Vector | |
| public Vector | |
| public Vector | getTargetRelationKeyFieldNames()
PUBLIC: Return the target relation key field names associated with the mapping. |
| public Vector | getTargetRelationKeyFields()
INTERNAL: Return all the target relation key fields associated with the mapping. |
| protected boolean | |
| protected boolean | |
| public boolean | hasDependency()
Overrides org. |
| public void | initialize(AbstractSession session)
Overrides org. |
| protected void | initializeChangeOrderTargetQuery(AbstractSession session)
Overrides org. |
| protected void | |
| protected void | initializeListOrderFieldTable(AbstractSession session)
Overrides org. |
| protected void | initializeSelectionCriteriaAndAddFieldsToQuery(Expression startCriteria)
INTERNAL: Selection criteria is created to read target records from the table. |
| protected void | insertAddedObjectEntry(ObjectLevelModifyQuery query, Object objectAdded, Map<K, V> extraData)
INTERNAL: An object was added to the collection during an update, insert it. |
| public void | |
| public void | insertTargetObjects(WriteObjectQuery query)
INTERNAL: Write the target objects if the cascade policy requires them to be written first. |
| public boolean | isDefinedAsOneToManyMapping()
INTERNAL: Return whether this mapping was originally defined as a OneToMany. |
| public boolean | isJoiningSupported()
Overrides org. |
| public boolean | isManyToManyMapping()
Overrides org. |
| public boolean | |
| public boolean | isRelationalMapping()
Overrides org. |
| protected void | objectAddedDuringUpdate(ObjectLevelModifyQuery query, Object objectAdded, ObjectChangeSet changeSet, Map<K, V> extraData)
Overrides org. |
| protected void | objectOrderChangedDuringUpdate(WriteObjectQuery query, Object orderChangedObject, int orderIndex)
Overrides org. |
| protected void | objectRemovedDuringUpdate(ObjectLevelModifyQuery query, Object objectDeleted, Map<K, V> extraData)
Overrides org. |
| public void | performDataModificationEvent(Object[] event, AbstractSession session)
Overrides org. |
| public void | postInitialize(AbstractSession session)
Overrides org. |
| public void | postInsert(WriteObjectQuery query)
Overrides org. |
| protected void | postPrepareNestedBatchQuery(ReadQuery batchQuery, ObjectLevelReadQuery query)
Overrides org. |
| public void | postUpdate(WriteObjectQuery query)
Overrides org. |
| public void | preDelete(DeleteObjectQuery query)
Overrides org. |
| protected ReadQuery | prepareHistoricalQuery(ReadQuery targetQuery, ObjectBuildingQuery sourceQuery, AbstractSession executionSession)
Overrides org. |
| protected void | prepareTranslationRow(AbstractRecord translationRow, Object object, ClassDescriptor descriptor, AbstractSession session)
Overrides org. |
| public void | setCustomDeleteQuery(DataModifyQuery query)
PUBLIC: The default delete query for mapping can be overridden by specifying the new query. |
| public void | setCustomInsertQuery(DataModifyQuery query)
PUBLIC: The default insert query for mapping can be overridden by specifying the new query. |
| public void | setDefinedAsOneToManyMapping(boolean isDefinedAsOneToManyMapping)
INTERNAL: Set whether this mapping was originally defined as a OneToMany |
| public void | |
| protected void | |
| public void | |
| public void | |
| public void | |
| protected void | |
| public void | |
| public void | |
| pack-priv void | setRelationTableMechanism(RelationTableMechanism mechanism)
PUBLIC: Allows to set RelationTableMechanism to be owned by the mapping. |
| public void | |
| public void | setSessionName(String name)
Overrides org. |
| public void | setSourceKeyFieldNames(Vector<E> fieldNames)
PUBLIC: Set the source key field names associated with the mapping. |
| public void | |
| public void | setSourceRelationKeyFieldName(String sourceRelationKeyFieldName)
PUBLIC: Set the source key field in the relation table. |
| public void | setSourceRelationKeyFieldNames(Vector<E> fieldNames)
PUBLIC: Set the source relation key field names associated with the mapping. |
| public void | setSourceRelationKeyFields(Vector<DatabaseField> sourceRelationKeyFields)
INTERNAL: Set the source fields. |
| public void | setTargetKeyFieldNames(Vector<E> fieldNames)
INTERNAL: Set the target key field names associated with the mapping. |
| public void | |
| public void | setTargetRelationKeyFieldName(String targetRelationKeyFieldName)
PUBLIC: Set the target key field in the relation table. |
| public void | setTargetRelationKeyFieldNames(Vector<E> fieldNames)
INTERNAL: Set the target relation key field names associated with the mapping. |
| public void | setTargetRelationKeyFields(Vector<DatabaseField> targetRelationKeyFields)
INTERNAL: Set the target fields. |
| public boolean | shouldUseListOrderFieldTableExpression()
Overrides org. |