Top Description Fields Constructors Methods
org.eclipse.persistence.eis.mappings

public Class EISOneToManyMapping

extends CollectionMapping
implements EISMapping
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.eis.mappings.EISMapping
Imports
java.util.ArrayList, .Collection, .HashMap, .Iterator, .List, .Map, .Vector, org.eclipse.persistence.eis.EISDescriptor, .EISException, org.eclipse.persistence.exceptions.DatabaseException, .DescriptorException, .OptimisticLockException, .QueryException, org.eclipse.persistence.expressions.Expression, .ExpressionBuilder, org.eclipse.persistence.indirection.ValueHolder, org.eclipse.persistence.internal.descriptors.ObjectBuilder, org.eclipse.persistence.internal.helper.DatabaseField, .DatabaseTable, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.internal.indirection.EISOneToManyQueryBasedValueHolder, org.eclipse.persistence.internal.oxm.XPathEngine, org.eclipse.persistence.internal.queries.ContainerPolicy, .JoinedAttributeManager, org.eclipse.persistence.internal.sessions.AbstractRecord, .AbstractSession, .ChangeRecord, .MergeManager, .ObjectChangeSet, .UnitOfWorkChangeSet, .UnitOfWorkImpl, org.eclipse.persistence.mappings.CollectionMapping, org.eclipse.persistence.oxm.XMLField, org.eclipse.persistence.oxm.record.DOMRecord, .XMLRecord, org.eclipse.persistence.queries.Call, .DataModifyQuery, .DeleteAllQuery, .DeleteObjectQuery, .InsertObjectQuery, .ModifyQuery, .ObjectBuildingQuery, .ObjectLevelModifyQuery, .ObjectLevelReadQuery, .QueryByExamplePolicy, .ReadQuery, .WriteObjectQuery, org.w3c.dom.Element

An EIS one-to-many mapping is a reference mapping that represents the relationship between a single source object and a collection of mapped persistent Java objects. The source object usually contains a foreign key (pointer) to the target objects (key on source); alternatively, the target objects may contain a foreign key to the source object (key on target). Because both the source and target objects use interactions, they must all be configured as root object types.

Record formats
Record Type Description
Indexed Ordered collection of record elements. The indexed record EIS format enables Java class attribute values to be retreived by position or index.
Mapped Key-value map based representation of record elements. The mapped record EIS format enables Java class attribute values to be retreived by an object key.
XML Record/Map representation of an XML DOM element.
Since
Oracle TopLink 10g Release 2 (10.1.3)
See Also
org.eclipse.persistence.eis.EISDescriptor#useIndexedRecordFormat, org.eclipse.persistence.eis.EISDescriptor#useMappedRecordFormat, org.eclipse.persistence.eis.EISDescriptor#useXMLRecordFormat

Field Summary

Modifier and TypeField and Description
protected DatabaseField
foreignKeyGroupingElement

The grouping-element field.

protected boolean
isForeignKeyRelationship

Keeps track if any of the fields are foreign keys.

protected transient List<DatabaseField>
sourceForeignKeyFields

The (typically primary) source key fields that are referenced by the targetForeignKeyFields.

protected transient Map<DatabaseField, DatabaseField>
sourceForeignKeysToTargetKeys

This maps the source foreign key fields to the corresponding (primary) target key fields.

protected transient List<DatabaseField>
targetForeignKeyFields

The target foreign key fields that reference the sourceKeyFields.

Inherited from org.eclipse.persistence.mappings.CollectionMapping:
changeOrderTargetQuerycontainerPolicydeleteAllQueryhasCustomDeleteAllQueryhasOrderByisListOrderFieldSupportedisSynchronizeOnMergelistOrderFieldmustDeleteReferenceObjectsOneByOneorderCorrectionType

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addForeignKeyField(DatabaseField sourceForeignKeyField, DatabaseField targetKeyField)

Overrides org.eclipse.persistence.mappings.ForeignReferenceMapping.addForeignKeyField.

PUBLIC: Define the source foreign key relationship in the one-to-many mapping.
public void
addForeignKeyFieldName(String sourceForeignKeyFieldName, String targetKeyFieldName)

PUBLIC: Define the source foreign key relationship in the one-to-many mapping.

public Object
buildAddedElementFromChangeSet(Object changeSet, MergeManager mergeManager, AbstractSession targetSession)

INTERNAL: Build and return a new element based on the change set.

public Object
buildChangeSet(Object element, ObjectChangeSet owner, AbstractSession session)

INTERNAL: Build and return a change set for the specified element.

protected Object
buildElementFromChangeSet(Object changeSet, MergeManager mergeManager, AbstractSession targetSession)

Build and return a new element based on the change set.

public Object
buildElementFromElement(Object element, MergeManager mergeManager, AbstractSession targetSession)

INTERNAL: Build and return a new element based on the specified element.

public Expression
buildExpression(Object
TODO
queryObject
,
QueryByExamplePolicy
TODO
policy
,
Expression
TODO
expressionBuilder
,
Map<K, V>
TODO
processedObjects
,
AbstractSession
TODO
session
)

Overrides org.eclipse.persistence.mappings.CollectionMapping.buildExpression.

INTERNAL: In case Query By Example is used, this method builds and returns an expression that corresponds to a single attribute and it's value.
public Object
buildRemovedElementFromChangeSet(Object changeSet, MergeManager mergeManager, AbstractSession targetSession)

INTERNAL: Build and return a new element based on the change set.

public Object
clone()

Overrides org.eclipse.persistence.mappings.CollectionMapping.clone.

INTERNAL: Clone the appropriate attributes.
protected Vector<DatabaseField>
collectFields()

Overrides org.eclipse.persistence.mappings.DatabaseMapping.collectFields.

Return all the fields mapped by the mapping.
public boolean
compareElements(Object element1, Object element2, AbstractSession session)

INTERNAL: Compare the non-null elements and return true if they are alike.

public boolean
compareElementsForChange(Object element1, Object element2, AbstractSession session)

INTERNAL: Compare the non-null elements and return true if they are alike.

public ChangeRecord
compareForChange(Object
TODO
clone
,
Object
TODO
backup
,
ObjectChangeSet
TODO
owner
,
AbstractSession
TODO
session
)

Overrides org.eclipse.persistence.mappings.CollectionMapping.compareForChange.

INTERNAL: Compare the changes between two collections.
public boolean
compareObjects(Object
TODO
object1
,
Object
TODO
object2
,
AbstractSession
TODO
session
)

Overrides org.eclipse.persistence.mappings.CollectionMapping.compareObjects.

INTERNAL: Compare the attributes belonging to this mapping for the objects.
protected void
deleteAll(DeleteObjectQuery query, Object referenceObjects)

Delete all the reference objects.

protected void
deleteAll(DeleteObjectQuery query)

Delete all the reference objects.

protected void
deleteReferenceObjectsLeftOnDatabase(DeleteObjectQuery query)

This method will make sure that all the records privately owned by this mapping are actually removed.

protected AbstractRecord
extractKeyRowFromReferenceObject(Object object, AbstractSession session, AbstractRecord parentRecord)

Build and return a database row that contains a foreign key for the specified reference object.

public ModifyQuery
public DatabaseField
getForeignKeyGroupingElement()

Get the grouping element field on the mapping.

public Vector<E>
public List<DatabaseField>
getSourceForeignKeyFields()

INTERNAL: Return the source foreign key fields.

public Map<DatabaseField, DatabaseField>
getSourceForeignKeysToTargetKeys()

INTERNAL: Sets the target foreign key fields.

public List<DatabaseField>
getTargetForeignKeyFields()

INTERNAL: Return the source foreign key fields.

public boolean
public boolean
hasInverseConstraintDependency()

Overrides org.eclipse.persistence.mappings.DatabaseMapping.hasInverseConstraintDependency.

INTERNAL: Return whether the mapping has any inverse constraint dependencies, such as foreign keys.
public void
protected void
initializeDeleteAllQuery()

Initialize the delete all query.

protected void
initializeSelectionCriteria(AbstractSession session)

INTERNAL: Selection criteria is created with source foreign keys and target keys.

protected void
public boolean
public boolean
isForeignKeyRelationship()

INTERNAL: Return if the 1-M mapping has a foreign key dependency to its target.

public boolean
mapKeyHasChanged(Object element, AbstractSession session)

INTERNAL: Return whether the element's user-defined Map key has changed since it was cloned from the original version.

public void
mergeChangesIntoObject(Object target, ChangeRecord chgRecord, Object source, MergeManager mergeManager, AbstractSession targetSession)

Overrides org.eclipse.persistence.mappings.CollectionMapping.mergeChangesIntoObject.

INTERNAL: If the mapping has a foreign key, it is order, so must use a different merge.
public void
mergeIntoObject(Object target, boolean isTargetUnInitialized, Object source, MergeManager mergeManager, AbstractSession targetSession)

Overrides org.eclipse.persistence.mappings.CollectionMapping.mergeIntoObject.

INTERNAL: If the mapping has a foreign key, it is order, so must use a different merge.
public void
postDelete(DeleteObjectQuery query)

Overrides org.eclipse.persistence.mappings.CollectionMapping.postDelete.

INTERNAL: Delete the reference objects.
public void
postInsert(WriteObjectQuery query)

Overrides org.eclipse.persistence.mappings.CollectionMapping.postInsert.

INTERNAL: Insert the reference objects.
public void
postUpdate(WriteObjectQuery query)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.postUpdate.

INTERNAL: Update the reference objects.
public void
preDelete(DeleteObjectQuery query)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.preDelete.

INTERNAL: Delete the reference objects.
public void
public void
preInsert(WriteObjectQuery query)

Overrides org.eclipse.persistence.mappings.CollectionMapping.preInsert.

INTERNAL: Insert privately owned parts
public void
preUpdate(WriteObjectQuery query)

Overrides org.eclipse.persistence.mappings.CollectionMapping.preUpdate.

INTERNAL: Update the privately owned parts.
public void
setDeleteAllCall(Call call)

Overrides org.eclipse.persistence.mappings.CollectionMapping.setDeleteAllCall.

PUBLIC: The default delete all call for this mapping can be overridden by specifying the new call.
public void
setDeleteAllSQLString(String sqlString)

Overrides org.eclipse.persistence.mappings.CollectionMapping.setDeleteAllSQLString.

INTERNAL: This method is not supported in an EIS environment.
public void
setForeignKeyGroupingElement(String name)

Set the grouping element field on the mapping.

public void
setForeignKeyGroupingElement(DatabaseField field)

Set if the grouping element field on the mapping.

public void
setIsForeignKeyRelationship(boolean isForeignKeyRelationship)

INTERNAL: Set if the 1-M mapping has a foreign key dependency to its target.

public void
setSelectionSQLString(String sqlString)

Overrides org.eclipse.persistence.mappings.ForeignReferenceMapping.setSelectionSQLString.

INTERNAL: This method is not supported in an EIS environment.
public void
setSourceForeignKeyFields(List<DatabaseField> fields)

INTERNAL: Sets the source foreign key fields.

public void
setSourceForeignKeysToTargetKeys(Map<DatabaseField, DatabaseField> sourceToTargetKeyFields)

INTERNAL: Set the source keys to target keys fields association.

public void
setTargetForeignKeyFields(List<DatabaseField> fields)

INTERNAL: Sets the target foreign key fields.

protected boolean
shouldObjectModifyCascadeToParts(ObjectLevelModifyQuery query)

Overrides org.eclipse.persistence.mappings.ForeignReferenceMapping.shouldObjectModifyCascadeToParts.

Return whether any process leading to object modification should also affect its parts.
public void
simpleAddToCollectionChangeRecord(Object referenceKey, Object changeSetToAdd, ObjectChangeSet changeSet, AbstractSession session)

Overrides org.eclipse.persistence.mappings.CollectionMapping.simpleAddToCollectionChangeRecord.

ADVANCED: This method is used to have an object add to a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.
public void
simpleRemoveFromCollectionChangeRecord(Object referenceKey, Object changeSetToRemove, ObjectChangeSet changeSet, AbstractSession session)

Overrides org.eclipse.persistence.mappings.CollectionMapping.simpleRemoveFromCollectionChangeRecord.

ADVANCED: This method is used to have an object removed from a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.
public Object
valueFromRow(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, CacheKey cacheKey, AbstractSession executionSession, boolean isTargetProtected, Boolean[] wasCacheUsed)

Overrides org.eclipse.persistence.mappings.ForeignReferenceMapping.valueFromRow.

INTERNAL: Return the value of the reference attribute or a value holder.
public boolean
verifyDelete(Object object, AbstractSession session)

Overrides org.eclipse.persistence.mappings.CollectionMapping.verifyDelete.

INTERNAL: Used to verify whether the specified object is deleted or not.
public void
writeFromObjectIntoRow(Object object, AbstractRecord row, AbstractSession session, DatabaseMapping.WriteType writeType)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.writeFromObjectIntoRow.

INTERNAL: Get the appropriate attribute value from the object and put it in the appropriate field of the database row.
public void
writeFromObjectIntoRowForShallowInsert(Object object, AbstractRecord row, AbstractSession session)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.writeFromObjectIntoRowForShallowInsert.

INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts.
public void
writeFromObjectIntoRowForShallowInsertWithChangeRecord(ChangeRecord changeRecord, AbstractRecord row, AbstractSession session)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.writeFromObjectIntoRowForShallowInsertWithChangeRecord.

INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts.
public void
writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery, AbstractRecord row)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.writeFromObjectIntoRowForUpdate.

INTERNAL: If any of the references objects has changed, write out all the keys.
public void
writeFromObjectIntoRowForUpdateAfterShallowInsert(Object object, AbstractRecord row, AbstractSession session, DatabaseTable table)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.writeFromObjectIntoRowForUpdateAfterShallowInsert.

INTERNAL: This row is built for update after shallow insert which happens in case of bidirectional inserts.
public void
writeFromObjectIntoRowWithChangeRecord(ChangeRecord changeRecord, AbstractRecord row, AbstractSession session, DatabaseMapping.WriteType writeType)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.writeFromObjectIntoRowWithChangeRecord.

INTERNAL: Get the appropriate attribute value from the object and put it in the appropriate field of the database row.
public void
writeInsertFieldsIntoRow(AbstractRecord row, AbstractSession session)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.writeInsertFieldsIntoRow.

INTERNAL: Write fields needed for insert into the template for with null values.
Inherited from org.eclipse.persistence.mappings.CollectionMapping:
addAggregateOrderByaddAscendingOrderingaddDescendingOrderingaddOrderBybuildBackupCloneForPartObjectbuildChangeRecordbuildCloneForPartObjectbuildContainerClonebuildCopybuildElementClonebuildElementUnitOfWorkClonebuildListOrderFieldbuildReferencesPKListcalculateDeferredChangescascadeDiscoverAndPersistUnregisteredNewObjectscascadePerformRemoveIfRequiredcascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequiredcascadeRegisterNewIfRequiredcollectQueryParameterscompareCollectionsForChangecompareListscompareListsAndWritecompareObjectsAndWritecompareObjectsWithoutPrivateOwnedcompareObjectsWithPrivateOwnedconvertClassNamesToClassescopyElementexecuteBatchQueryextractKeyFromTargetRowextractResultFromBatchQueryfixRealObjectReferencesgetAdditionalFieldsBaseExpressiongetContainerPolicygetJoinCriteriagetListOrderFieldgetObjectCorrespondingTogetOrderByQueryKeyExpressionsgetOrderCorrectionTypegetRealCollectionAttributeValueFromObjectgetSelectionQueryContainerPolicygetTargetPrimaryKeyFieldshasOrderByinitializeChangeOrderTargetQueryinitializeListOrderFieldinitializeListOrderFieldTableisAttributeValueInstantiatedOrChangedisChangeTrackingSupportedisCollectionMappingisListOrderFieldSupportedisMapKeyObjectRelationshipiterateOnElementiterateOnRealAttributeValueloadloadAllmustDeleteReferenceObjectsOneByOneobjectAddedDuringUpdateobjectOrderChangedDuringUpdateobjectRemovedDuringUpdateobjectUnchangedDuringUpdateobjectUnchangedDuringUpdatepostCalculateChangespostInitializepostPrepareNestedBatchQueryprepareTranslationRowreadPrivateOwnedForObjectrecordPrivateOwnedRemovalsreplaceValueHoldersInsetChangeListenersetContainerPolicysetCustomDeleteAllQuerysetDeleteAllQuerysetHasCustomDeleteAllQuerysetListOrderFieldsetListOrderFieldNamesetMustDeleteReferenceObjectsOneByOnesetOrderCorrectionTypesetSelectionQueryContainerPolicysetSessionNamesetUseLazyInstantiationForIndirectCollectionshouldUseLazyInstantiationForIndirectCollectionshouldUseListOrderFieldTableExpressionupdateChangeRecordupdateChangeRecordForSelfMergeupdateCollectionChangeRecorduseCollectionClassuseCollectionClassNameuseListClassNameuseMapClassuseMapClassuseMapClassNameuseSortedSetClassuseSortedSetClassNameuseSortedSetClassNameuseTransparentCollectionuseTransparentListuseTransparentMapuseTransparentSetvalidateBeforeInitializationvalueFromPKListvalueFromRowInternalWithJoinwriteChanges