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

public Class UnidirectionalOneToManyMapping

extends OneToManyMapping
Class Inheritance
Imports
java.util.Iterator, .Vector, org.eclipse.persistence.config.SystemProperties, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.exceptions.ConversionException, .DatabaseException, .DescriptorException, .OptimisticLockException, org.eclipse.persistence.internal.descriptors.CascadeLockingPolicy, org.eclipse.persistence.internal.helper.ConversionManager, .DatabaseField, org.eclipse.persistence.internal.security.PrivilegedAccessHelper, org.eclipse.persistence.internal.sessions.AbstractRecord, .AbstractSession, .ChangeRecord, .CollectionChangeRecord, .ObjectChangeSet, .UnitOfWorkChangeSet, .UnitOfWorkImpl, org.eclipse.persistence.queries.DeleteObjectQuery, .ObjectLevelModifyQuery, .ObjectLevelReadQuery, .ReadAllQuery, .ReadQuery, org.eclipse.persistence.sessions.DatabaseRecord

Purpose: UnidirectionalOneToManyMapping doesn't have 1:1 back reference mapping.

Author
Andrei Ilitchev
Since
Eclipselink 1.1

Field Summary

Modifier and TypeField and Description
protected boolean
shouldIncrementTargetLockValueOnAddOrRemoveTarget

Indicates whether target's optimistic locking value should be incremented on target being added to / removed from a source.

protected boolean
shouldIncrementTargetLockValueOnDeleteSource

Indicates whether target's optimistic locking value should be incremented on the source deletion.

Inherited from org.eclipse.persistence.mappings.OneToManyMapping:
addTargetQueryhasCustomAddTargetQueryhasCustomRemoveAllTargetsQueryhasCustomRemoveTargetQueryObjectAddedObjectRemovedPostInsertremoveAllTargetsQueryremoveTargetQueryshouldDeferInsertssourceExpressionsToPostInitializesourceKeyFieldssourceKeysToTargetForeignKeystargetExpressionsToPostInitializetargetForeignKeyFieldstargetForeignKeysToSourceKeystargetForeignKeyTabletargetPrimaryKeyFields

Constructor Summary

AccessConstructor and Description
public
UnidirectionalOneToManyMapping()

PUBLIC: Default constructor.

Method Summary

Modifier and TypeMethod and Description
protected AbstractRecord
buildKeyRowForTargetUpdate(ObjectLevelModifyQuery query)

Overrides org.eclipse.persistence.mappings.OneToManyMapping.buildKeyRowForTargetUpdate.

INTERNAL: Build a row containing the keys for use in the query that updates the row for the target object during an insert or update
public ChangeRecord

Returns:

org.eclipse.persistence.internal.sessions.ChangeRecord
compareForChange
(Object
TODO
clone
,
Object
TODO
backUp
,
ObjectChangeSet
TODO
owner
,
AbstractSession
TODO
uow
)

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

INTERNAL: This method is used to create a change record from comparing two collections
protected AbstractRecord
protected Vector<E>
extractSourceKeyFromRow(AbstractRecord row, AbstractSession session)

INTERNAL: Extract the source primary key value from the target row.

public void
public boolean
public boolean
public void
postCalculateChanges(ChangeRecord changeRecord, UnitOfWorkImpl uow)

Overrides org.eclipse.persistence.mappings.CollectionMapping.postCalculateChanges.

INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.
public void
postCalculateChangesOnDeleted(Object deletedObject, UnitOfWorkChangeSet uowChangeSet, UnitOfWorkImpl uow)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.postCalculateChangesOnDeleted.

INTERNAL: Overridden by mappings that require objects to be deleted contribute to change set creation.
public void
postInitialize(AbstractSession session)

Overrides org.eclipse.persistence.mappings.CollectionMapping.postInitialize.

Initialize the type of the target foreign key, as it will be null as it is not mapped in the target.
protected void
public void
preDelete(DeleteObjectQuery query)

Overrides org.eclipse.persistence.mappings.OneToManyMapping.preDelete.

INTERNAL: Delete the reference objects.
public void
protected void
prepareTranslationRow(AbstractRecord translationRow, Object object, ClassDescriptor descriptor, AbstractSession session)

Overrides org.eclipse.persistence.mappings.CollectionMapping.prepareTranslationRow.

INTERNAL: The translation row may require additional fields than the primary key if the mapping in not on the primary key.
public void
recordPrivateOwnedRemovals(Object object, UnitOfWorkImpl uow)

Overrides org.eclipse.persistence.mappings.CollectionMapping.recordPrivateOwnedRemovals.

INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.
public boolean
requiresDataModificationEvents()

Overrides org.eclipse.persistence.mappings.OneToManyMapping.requiresDataModificationEvents.

INTERNAL: UnidirectionalOneToManyMapping performs some events after INSERT/UPDATE to maintain the keys
public void
setShouldIncrementTargetLockValueOnAddOrRemoveTarget(boolean shouldIncrementTargetLockValueOnAddOrRemoveTarget)

PUBLIC: Set value that indicates whether target's optimistic locking value should be incremented on target being added to / removed from a source (default value is true).

public void
setShouldIncrementTargetLockValueOnDeleteSource(boolean shouldIncrementTargetLockValueOnDeleteSource)

PUBLIC: Set value that indicates whether target's optimistic locking value should be incremented on the source deletion (default value is true).

public boolean
public boolean
shouldIncrementTargetLockValueOnAddOrRemoveTarget()

PUBLIC: Indicates whether target's optimistic locking value should be incremented on target being added to / removed from a source (default value is true).

public boolean
shouldIncrementTargetLockValueOnDeleteSource()

PUBLIC: Indicates whether target's optimistic locking value should be incremented on the source deletion (default value is true).

protected boolean
shouldRemoveTargetQueryModifyTargetForeignKey()

Overrides org.eclipse.persistence.mappings.OneToManyMapping.shouldRemoveTargetQueryModifyTargetForeignKey.

INTERNAL Target foreign key of the removed object should be modified (set to null).
Inherited from org.eclipse.persistence.mappings.OneToManyMapping:
addTargetForeignKeyFieldaddTargetForeignKeyFieldNamebuildBatchCriteriabuildDefaultSelectionCriteriaAndAddFieldsToQuerybuildListOrderFieldbuildSelectionCriteriaclonecollectQueryParameterscreateMapComponentFromRowdeleteAlldeleteReferenceObjectsLeftOnDatabaseextractBatchKeyFromRowextractKeyFromTargetRowgetDeleteAllQuerygetFieldsForTranslationInAggregategetInsertObjectQuerygetSourceKeyFieldNamesgetSourceKeyFieldsgetSourceKeysToTargetForeignKeysgetTargetForeignKeyFieldNamesgetTargetForeignKeyFieldsgetTargetForeignKeysToSourceKeysgetTargetPrimaryKeyFieldshasInverseConstraintDependencyinitializeAddTargetQueryinitializeChangeOrderTargetQueryinitializeDeleteAllQueryinitializeReferenceDescriptorinitializeRemoveAllTargetsQueryinitializeRemoveTargetQueryinitializeTargetForeignKeysToSourceKeysinitializeTargetPrimaryKeyFieldsisCascadedLockingSupportedisJoiningSupportedisOneToManyMappingisRelationalMappingisSourceKeySpecifiedobjectAddedDuringUpdateobjectRemovedDuringUpdateperformDataModificationEventpostInitializeSourceAndTargetExpressionspostInsertpostUpdatesetAddTargetSQLStringsetCustomAddTargetQuerysetCustomRemoveAllTargetsQuerysetCustomRemoveTargetQuerysetDeleteAllSQLStringsetSessionNamesetShouldDeferInsertsetSourceKeyFieldNamessetSourceKeyFieldssetTargetForeignKeyFieldNamesetTargetForeignKeyFieldNamessetTargetForeignKeyFieldNamessetTargetForeignKeyFieldssetTargetForeignKeysToSourceKeysshouldObjectModifyCascadeToPartsupdateTargetForeignKeyPostUpdateSource_ObjectAddedupdateTargetForeignKeyPostUpdateSource_ObjectRemovedupdateTargetRowPostInsertSourceupdateTargetRowPreDeleteSourceverifyDelete

Field Detail

shouldIncrementTargetLockValueOnAddOrRemoveTargetback to summary
protected boolean shouldIncrementTargetLockValueOnAddOrRemoveTarget

Indicates whether target's optimistic locking value should be incremented on target being added to / removed from a source.

shouldIncrementTargetLockValueOnDeleteSourceback to summary
protected boolean shouldIncrementTargetLockValueOnDeleteSource

Indicates whether target's optimistic locking value should be incremented on the source deletion. Note that if the flag is set to true then the indirection will be triggered on source delete - in order to verify all targets' versions.

Constructor Detail

UnidirectionalOneToManyMappingback to summary
public UnidirectionalOneToManyMapping()

PUBLIC: Default constructor.

Method Detail

buildKeyRowForTargetUpdateback to summary
protected AbstractRecord buildKeyRowForTargetUpdate(ObjectLevelModifyQuery query)

Overrides org.eclipse.persistence.mappings.OneToManyMapping.buildKeyRowForTargetUpdate.

INTERNAL: Build a row containing the keys for use in the query that updates the row for the target object during an insert or update

Annotations
@Override
compareForChangeback to summary
public ChangeRecord compareForChange(Object clone, Object backUp, ObjectChangeSet owner, AbstractSession uow)

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

INTERNAL: This method is used to create a change record from comparing two collections

Parameters
clone:Object

Doc from org.eclipse.persistence.mappings.DatabaseMapping.compareForChange.

TODO

backUp:Object

Doc from org.eclipse.persistence.mappings.DatabaseMapping.compareForChange.

TODO

owner:ObjectChangeSet

Doc from org.eclipse.persistence.mappings.DatabaseMapping.compareForChange.

TODO

uow:AbstractSession

Doc from org.eclipse.persistence.mappings.DatabaseMapping.compareForChange.

TODO

Returns:ChangeRecord

org.eclipse.persistence.internal.sessions.ChangeRecord

Annotations
@Override
createModifyRowForAddTargetQueryback to summary
protected AbstractRecord createModifyRowForAddTargetQuery()

Overrides org.eclipse.persistence.mappings.OneToManyMapping.createModifyRowForAddTargetQuery.

INTERNAL:

Annotations
@Override
extractSourceKeyFromRowback to summary
protected Vector<E> extractSourceKeyFromRow(AbstractRecord row, AbstractSession session)

INTERNAL: Extract the source primary key value from the target row. Used for batch reading, most following same order and fields as in the mapping.

initializeback to summary
public void initialize(AbstractSession session) throws DescriptorException

Overrides org.eclipse.persistence.mappings.OneToManyMapping.initialize.

INTERNAL: Initialize the mapping.

Annotations
@Override
isOwnedback to summary
public boolean isOwned()

Overrides org.eclipse.persistence.mappings.DatabaseMapping.isOwned.

INTERNAL:

Annotations
@Override
isUnidirectionalOneToManyMappingback to summary
public boolean isUnidirectionalOneToManyMapping()

Overrides org.eclipse.persistence.mappings.DatabaseMapping.isUnidirectionalOneToManyMapping.

INTERNAL:

Annotations
@Override
postCalculateChangesback to summary
public void postCalculateChanges(ChangeRecord changeRecord, UnitOfWorkImpl uow)

Overrides org.eclipse.persistence.mappings.CollectionMapping.postCalculateChanges.

INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.

Annotations
@Override
postCalculateChangesOnDeletedback to summary
public void postCalculateChangesOnDeleted(Object deletedObject, UnitOfWorkChangeSet uowChangeSet, UnitOfWorkImpl uow)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.postCalculateChangesOnDeleted.

INTERNAL: Overridden by mappings that require objects to be deleted contribute to change set creation.

Annotations
@Override
postInitializeback to summary
public void postInitialize(AbstractSession session)

Overrides org.eclipse.persistence.mappings.CollectionMapping.postInitialize.

Initialize the type of the target foreign key, as it will be null as it is not mapped in the target.

Annotations
@Override
postPrepareNestedBatchQueryback to summary
protected void postPrepareNestedBatchQuery(ReadQuery batchQuery, ObjectLevelReadQuery query)

Overrides org.eclipse.persistence.mappings.CollectionMapping.postPrepareNestedBatchQuery.

INTERNAL: Add additional fields

Annotations
@Override
preDeleteback to summary
public void preDelete(DeleteObjectQuery query) throws DatabaseException, OptimisticLockException

Overrides org.eclipse.persistence.mappings.OneToManyMapping.preDelete.

INTERNAL: Delete the reference objects.

Annotations
@Override
prepareCascadeLockingPolicyback to summary
public void prepareCascadeLockingPolicy()

Overrides org.eclipse.persistence.mappings.OneToManyMapping.prepareCascadeLockingPolicy.

Prepare a cascade locking policy.

Annotations
@Override
prepareTranslationRowback to summary
protected void prepareTranslationRow(AbstractRecord translationRow, Object object, ClassDescriptor descriptor, AbstractSession session)

Overrides org.eclipse.persistence.mappings.CollectionMapping.prepareTranslationRow.

INTERNAL: The translation row may require additional fields than the primary key if the mapping in not on the primary key.

Annotations
@Override
recordPrivateOwnedRemovalsback to summary
public void recordPrivateOwnedRemovals(Object object, UnitOfWorkImpl uow)

Overrides org.eclipse.persistence.mappings.CollectionMapping.recordPrivateOwnedRemovals.

INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.

Annotations
@Override
requiresDataModificationEventsback to summary
public boolean requiresDataModificationEvents()

Overrides org.eclipse.persistence.mappings.OneToManyMapping.requiresDataModificationEvents.

INTERNAL: UnidirectionalOneToManyMapping performs some events after INSERT/UPDATE to maintain the keys

Annotations
@Override
setShouldIncrementTargetLockValueOnAddOrRemoveTargetback to summary
public void setShouldIncrementTargetLockValueOnAddOrRemoveTarget(boolean shouldIncrementTargetLockValueOnAddOrRemoveTarget)

PUBLIC: Set value that indicates whether target's optimistic locking value should be incremented on target being added to / removed from a source (default value is true).

setShouldIncrementTargetLockValueOnDeleteSourceback to summary
public void setShouldIncrementTargetLockValueOnDeleteSource(boolean shouldIncrementTargetLockValueOnDeleteSource)

PUBLIC: Set value that indicates whether target's optimistic locking value should be incremented on the source deletion (default value is true).

shouldDeferInsertback to summary
public boolean shouldDeferInsert()

Overrides org.eclipse.persistence.mappings.OneToManyMapping.shouldDeferInsert.

Annotations
@Override
shouldIncrementTargetLockValueOnAddOrRemoveTargetback to summary
public boolean shouldIncrementTargetLockValueOnAddOrRemoveTarget()

PUBLIC: Indicates whether target's optimistic locking value should be incremented on target being added to / removed from a source (default value is true).

shouldIncrementTargetLockValueOnDeleteSourceback to summary
public boolean shouldIncrementTargetLockValueOnDeleteSource()

PUBLIC: Indicates whether target's optimistic locking value should be incremented on the source deletion (default value is true).

shouldRemoveTargetQueryModifyTargetForeignKeyback to summary
protected boolean shouldRemoveTargetQueryModifyTargetForeignKey()

Overrides org.eclipse.persistence.mappings.OneToManyMapping.shouldRemoveTargetQueryModifyTargetForeignKey.

INTERNAL Target foreign key of the removed object should be modified (set to null).

Annotations
@Override