org.eclipse.persistence.mappings
Class UnidirectionalOneToManyMapping
java.lang.Object
org.eclipse.persistence.mappings.DatabaseMapping
org.eclipse.persistence.mappings.ForeignReferenceMapping
org.eclipse.persistence.mappings.CollectionMapping
org.eclipse.persistence.mappings.OneToManyMapping
org.eclipse.persistence.mappings.UnidirectionalOneToManyMapping
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, ContainerMapping, MapComponentMapping, RelationalMapping
public class UnidirectionalOneToManyMapping
- extends OneToManyMapping
Purpose: UnidirectionalOneToManyMapping doesn't have 1:1 back reference mapping.
- Since:
- Eclipselink 1.1
- Author:
- Andrei Ilitchev
- See Also:
- Serialized Form
Method Summary |
org.eclipse.persistence.internal.sessions.ChangeRecord |
compareForChange(java.lang.Object clone,
java.lang.Object backUp,
org.eclipse.persistence.internal.sessions.ObjectChangeSet owner,
org.eclipse.persistence.internal.sessions.AbstractSession uow)
INTERNAL:
This method is used to create a change record from comparing two collections |
void |
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Initialize the mapping. |
boolean |
isOwned()
INTERNAL: |
boolean |
isUnidirectionalOneToManyMapping()
INTERNAL: |
void |
postCalculateChanges(ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL:
Overridden by mappings that require additional processing of the change record after the record has been calculated. |
void |
postCalculateChangesOnDeleted(java.lang.Object deletedObject,
org.eclipse.persistence.internal.sessions.UnitOfWorkChangeSet uowChangeSet,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL:
Overridden by mappings that require objects to be deleted contribute to change set creation. |
void |
postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
Initialize the type of the target foreign key, as it will be null as it is not mapped in the target. |
void |
preDelete(DeleteObjectQuery query)
INTERNAL:
Delete the reference objects. |
void |
prepareCascadeLockingPolicy()
Prepare a cascade locking policy. |
void |
recordPrivateOwnedRemovals(java.lang.Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL:
Overridden by mappings that require additional processing of the change record after the record has been calculated. |
boolean |
requiresDataModificationEvents()
INTERNAL:
UnidirectionalOneToManyMapping performs some events after INSERT/UPDATE to maintain the keys |
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). |
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). |
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). |
boolean |
shouldIncrementTargetLockValueOnDeleteSource()
PUBLIC:
Indicates whether target's optimistic locking value should be incremented on
the source deletion (default value is true). |
Methods inherited from class org.eclipse.persistence.mappings.OneToManyMapping |
addTargetForeignKeyField, addTargetForeignKeyFieldName, buildSelectionCriteria, clone, createMapComponentFromRow, extractResultFromBatchQuery, getSourceKeyFieldNames, getSourceKeyFields, getSourceKeysToTargetForeignKeys, getTargetForeignKeyFieldNames, getTargetForeignKeyFields, getTargetForeignKeysToSourceKeys, getTargetForeignKeyToSourceKeys, getTargetPrimaryKeyFields, hasInverseConstraintDependency, isCascadedLockingSupported, isJoiningSupported, isOneToManyMapping, isRelationalMapping, performDataModificationEvent, postInsert, postUpdate, setAddTargetSQLString, setCustomAddTargetQuery, setCustomRemoveAllTargetsQuery, setCustomRemoveTargetQuery, setDeleteAllSQLString, setSessionName, setSourceKeyFieldNames, setSourceKeyFields, setTargetForeignKeyFieldName, setTargetForeignKeyFieldNames, setTargetForeignKeyFieldNames, setTargetForeignKeyFields, updateTargetForeignKeyPostUpdateSource_ObjectAdded, updateTargetForeignKeyPostUpdateSource_ObjectRemoved, updateTargetRowPostInsertSource, updateTargetRowPreDeleteSource, verifyDelete |
Methods inherited from class org.eclipse.persistence.mappings.CollectionMapping |
addAggregateOrderBy, addAscendingOrdering, addDescendingOrdering, addOrderBy, buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildCopy, buildElementClone, buildReferencesPKList, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadeMerge, cascadePerformRemoveIfRequired, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cascadeRegisterNewIfRequired, compareCollectionsForChange, compareObjects, convertClassNamesToClasses, fixRealObjectReferences, getContainerPolicy, getJoinCriteria, getListOrderField, getListOrderFieldExpression, getObjectCorrespondingTo, getOrderByQueryKeyExpressions, getOrderCorrectionType, getRealCollectionAttributeValueFromObject, hasOrderBy, isAttributeValueInstantiatedOrChanged, isChangeTrackingSupported, isCollectionMapping, isListOrderFieldSupported, iterateOnElement, iterateOnRealAttributeValue, mergeChangesIntoObject, mergeIntoObject, postDelete, preInsert, prepareNestedBatchQuery, preUpdate, replaceValueHoldersIn, setChangeListener, setContainerPolicy, setCustomDeleteAllQuery, setDeleteAllCall, setListOrderField, setListOrderFieldName, setOrderCorrectionType, shouldUseListOrderFieldTableExpression, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, updateChangeRecord, updateCollectionChangeRecord, useCollectionClass, useCollectionClassName, useListClassName, useMapClass, useMapClass, useMapClassName, useSortedSetClass, useSortedSetClassName, useSortedSetClassName, useTransparentCollection, useTransparentList, useTransparentMap, useTransparentSet, validateBeforeInitialization, valueFromPKList |
Methods inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping |
buildBackupClone, buildClone, buildCloneFromRow, createUnitOfWorkValueHolder, dontUseBatchReading, dontUseIndirection, extendPessimisticLockScopeInSourceQuery, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getIndirectionPolicy, getJoinFetch, getRealAttributeValueFromAttribute, getReferenceClass, getReferenceClassName, getReferenceDescriptor, getRelationshipPartner, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getValueFromRemoteValueHolder, hasCustomSelectionQuery, instantiateAttribute, isAttributeValueInstantiated, isCascadeDetach, isCascadeMerge, isCascadePersist, isCascadeRefresh, isCascadeRemove, isForeignReferenceMapping, isInnerJoinFetched, isJoinFetched, isLazy, isLockableMapping, isOuterJoinFetched, isPrivateOwned, iterate, mergeRemoteValueHolder, preInitialize, prepareNestedJoins, privateOwnedRelationship, remoteInitialization, requiresTransientWeavedFields, setCascadeAll, setCascadeDetach, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setForceInitializationOfSelectionCriteria, setIndirectionPolicy, setIsPrivateOwned, setJoinFetch, setRealAttributeValueInObject, setReferenceClass, setReferenceClassName, setRelationshipPartner, setRelationshipPartnerAttributeName, setRequiresTransientWeavedFields, setSelectionCall, setSelectionCriteria, setSelectionSQLString, setShouldExtendPessimisticLockScope, setUsesBatchReading, setUsesIndirection, shouldExtendPessimisticLockScope, shouldExtendPessimisticLockScopeInDedicatedQuery, shouldExtendPessimisticLockScopeInSourceQuery, shouldExtendPessimisticLockScopeInTargetQuery, shouldMergeCascadeParts, shouldUseBatchReading, trimRowForJoin, trimRowForJoin, useBasicIndirection, useBatchReading, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection, valueFromRow |
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping |
buildExpression, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, derivesId, earlyPreDelete, getAttributeAccessor, getAttributeClassification, getAttributeName, getDerivedIdMapping, getDescriptor, getField, getFieldClassification, getFields, getGetMethodName, getMapsIdValue, getProperties, getProperty, getRealAttributeValueFromObject, getSelectFields, getSelectTables, getSetMethodName, getWeight, hasConstraintDependency, hasDependency, hasMapsIdValue, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCandidateForPrivateOwnedRemoval, isCloningRequired, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isJPAId, isManyToManyMapping, isMapKeyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToOneMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isStructureMapping, isTransformationMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, readFromResultSetIntoObject, readFromRowIntoObject, readOnly, readWrite, rehashFieldDependancies, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setDerivedIdMapping, setDerivesId, setDescriptor, setGetMethodName, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setSetMethodName, setWeight, toString, validateAfterInitialization, valueFromObject, valueFromResultSet, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowForWhereClause, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow, writeUpdateFieldsIntoRow |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
UnidirectionalOneToManyMapping
public UnidirectionalOneToManyMapping()
- PUBLIC:
Default constructor.
compareForChange
public org.eclipse.persistence.internal.sessions.ChangeRecord compareForChange(java.lang.Object clone,
java.lang.Object backUp,
org.eclipse.persistence.internal.sessions.ObjectChangeSet owner,
org.eclipse.persistence.internal.sessions.AbstractSession uow)
- INTERNAL:
This method is used to create a change record from comparing two collections
- Overrides:
compareForChange
in class CollectionMapping
- Returns:
- org.eclipse.persistence.internal.sessions.ChangeRecord
isOwned
public boolean isOwned()
- INTERNAL:
- Overrides:
isOwned
in class DatabaseMapping
isUnidirectionalOneToManyMapping
public boolean isUnidirectionalOneToManyMapping()
- INTERNAL:
- Overrides:
isUnidirectionalOneToManyMapping
in class DatabaseMapping
initialize
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DescriptorException
- INTERNAL:
Initialize the mapping.
- Overrides:
initialize
in class OneToManyMapping
- Throws:
DescriptorException
postInitialize
public void postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
- Initialize the type of the target foreign key, as it will be null as it is not mapped in the target.
- Overrides:
postInitialize
in class CollectionMapping
preDelete
public void preDelete(DeleteObjectQuery query)
throws DatabaseException,
OptimisticLockException
- INTERNAL:
Delete the reference objects.
- Overrides:
preDelete
in class OneToManyMapping
- Throws:
DatabaseException
OptimisticLockException
prepareCascadeLockingPolicy
public void prepareCascadeLockingPolicy()
- Prepare a cascade locking policy.
- Overrides:
prepareCascadeLockingPolicy
in class OneToManyMapping
postCalculateChanges
public void postCalculateChanges(ChangeRecord changeRecord,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
- INTERNAL:
Overridden by mappings that require additional processing of the change record after the record has been calculated.
- Overrides:
postCalculateChanges
in class CollectionMapping
postCalculateChangesOnDeleted
public void postCalculateChangesOnDeleted(java.lang.Object deletedObject,
org.eclipse.persistence.internal.sessions.UnitOfWorkChangeSet uowChangeSet,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
- INTERNAL:
Overridden by mappings that require objects to be deleted contribute to change set creation.
- Overrides:
postCalculateChangesOnDeleted
in class DatabaseMapping
recordPrivateOwnedRemovals
public void recordPrivateOwnedRemovals(java.lang.Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
- INTERNAL:
Overridden by mappings that require additional processing of the change record after the record has been calculated.
- Overrides:
recordPrivateOwnedRemovals
in class CollectionMapping
requiresDataModificationEvents
public boolean requiresDataModificationEvents()
- INTERNAL:
UnidirectionalOneToManyMapping performs some events after INSERT/UPDATE to maintain the keys
- Overrides:
requiresDataModificationEvents
in class OneToManyMapping
- Returns:
- See Also:
UnidirectionalOneToManyMapping
setShouldIncrementTargetLockValueOnAddOrRemoveTarget
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).
setShouldIncrementTargetLockValueOnDeleteSource
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).
shouldIncrementTargetLockValueOnAddOrRemoveTarget
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).
shouldIncrementTargetLockValueOnDeleteSource
public boolean shouldIncrementTargetLockValueOnDeleteSource()
- PUBLIC:
Indicates whether target's optimistic locking value should be incremented on
the source deletion (default value is true).