Package org.eclipse.persistence.mappings
Class UnidirectionalOneToManyMapping
- java.lang.Object
-
- org.eclipse.persistence.core.mappings.CoreMapping<AttributeAccessor,org.eclipse.persistence.internal.sessions.AbstractSession,org.eclipse.persistence.internal.queries.ContainerPolicy,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField>
-
- 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:
Serializable,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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.persistence.mappings.DatabaseMapping
DatabaseMapping.WriteType
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
INNER_JOIN, NONE, OUTER_JOIN, QUERY_BATCH_PARAMETER
-
-
Constructor Summary
Constructors Constructor Description UnidirectionalOneToManyMapping()PUBLIC: Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.persistence.internal.sessions.ChangeRecordcompareForChange(Object clone, 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 collectionsvoidinitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Initialize the mapping.booleanisOwned()INTERNAL:booleanisUnidirectionalOneToManyMapping()INTERNAL:voidpostCalculateChanges(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.voidpostCalculateChangesOnDeleted(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.voidpostInitialize(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.voidpreDelete(DeleteObjectQuery query)INTERNAL: Delete the reference objects.voidprepareCascadeLockingPolicy()Prepare a cascade locking policy.voidrecordPrivateOwnedRemovals(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.booleanrequiresDataModificationEvents()INTERNAL: UnidirectionalOneToManyMapping performs some events after INSERT/UPDATE to maintain the keysvoidsetShouldIncrementTargetLockValueOnAddOrRemoveTarget(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).voidsetShouldIncrementTargetLockValueOnDeleteSource(boolean shouldIncrementTargetLockValueOnDeleteSource)PUBLIC: Set value that indicates whether target's optimistic locking value should be incremented on the source deletion (default value is true).booleanshouldIncrementTargetLockValueOnAddOrRemoveTarget()PUBLIC: Indicates whether target's optimistic locking value should be incremented on target being added to / removed from a source (default value is true).booleanshouldIncrementTargetLockValueOnDeleteSource()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, collectQueryParameters, createMapComponentFromRow, getFieldsForTranslationInAggregate, getSourceKeyFieldNames, getSourceKeyFields, getSourceKeysToTargetForeignKeys, getTargetForeignKeyFieldNames, getTargetForeignKeyFields, getTargetForeignKeysToSourceKeys, getTargetForeignKeyToSourceKeys, getTargetPrimaryKeyFields, hasInverseConstraintDependency, isCascadedLockingSupported, isJoiningSupported, isOneToManyMapping, isRelationalMapping, performDataModificationEvent, postInitializeSourceAndTargetExpressions, 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, buildContainerClone, buildCopy, buildElementClone, buildElementUnitOfWorkClone, buildExpression, buildReferencesPKList, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cascadeRegisterNewIfRequired, compareCollectionsForChange, compareObjects, convertClassNamesToClasses, extractResultFromBatchQuery, fixRealObjectReferences, getContainerPolicy, getJoinCriteria, getListOrderField, getObjectCorrespondingTo, getOrderByQueryKeyExpressions, getOrderCorrectionType, getRealCollectionAttributeValueFromObject, hasOrderBy, isAttributeValueInstantiatedOrChanged, isChangeTrackingSupported, isCollectionMapping, isListOrderFieldSupported, isMapKeyObjectRelationship, iterateOnElement, iterateOnRealAttributeValue, load, loadAll, mergeChangesIntoObject, mergeIntoObject, mustDeleteReferenceObjectsOneByOne, postDelete, preInsert, preUpdate, replaceValueHoldersIn, setChangeListener, setContainerPolicy, setCustomDeleteAllQuery, setDeleteAllCall, setListOrderField, setListOrderFieldName, setMustDeleteReferenceObjectsOneByOne, setOrderCorrectionType, setUseLazyInstantiationForIndirectCollection, shouldUseLazyInstantiationForIndirectCollection, shouldUseListOrderFieldTableExpression, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, updateChangeRecord, updateChangeRecordForSelfMerge, updateCollectionChangeRecord, useCollectionClass, useCollectionClassName, useListClassName, useMapClass, useMapClass, useMapClassName, useSortedSetClass, useSortedSetClassName, useSortedSetClassName, useTransparentCollection, useTransparentList, useTransparentMap, useTransparentSet, validateBeforeInitialization, valueFromPKList, writeChanges
-
Methods inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
addForeignKeyField, buildBackupClone, buildClone, buildCloneFromRow, createCloneValueHolder, dontUseBatchReading, dontUseIndirection, extendPessimisticLockScopeInSourceQuery, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getBatchFetchType, getIndirectionPolicy, getJoinFetch, getMappedBy, getOrderByNormalizedExpressions, getPartitioningPolicy, getPartitioningPolicyName, getRealAttributeValueFromAttribute, getReferenceClass, getReferenceClassName, getReferenceDescriptor, getRelationshipPartner, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getValueFromRemoteValueHolder, hasCustomSelectionQuery, hasDependency, hasNestedIdentityReference, instantiateAttribute, isAttributeValueFromObjectInstantiated, isAttributeValueFullyBuilt, isAttributeValueInstantiated, isCascadeDetach, isCascadeMerge, isCascadeOnDeleteSetOnDatabase, isCascadePersist, isCascadeRefresh, isCascadeRemove, isForeignReferenceMapping, isInnerJoinFetched, isJoinFetched, isLazy, isLockableMapping, isOuterJoinFetched, isPrivateOwned, iterate, mergeRemoteValueHolder, preInitialize, prepareNestedBatchQuery, prepareNestedJoins, privateOwnedRelationship, readFromRowIntoObject, remoteInitialization, requiresTransientWeavedFields, setBatchFetchType, setCascadeAll, setCascadeDetach, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setForceInitializationOfSelectionCriteria, setIndirectionPolicy, setIsCacheable, setIsCascadeOnDeleteSetOnDatabase, setIsPrivateOwned, setJoinFetch, setMappedBy, setPartitioningPolicy, setPartitioningPolicyName, setRealAttributeValueInObject, setReferenceClass, setReferenceClassName, setRelationshipPartner, setRelationshipPartnerAttributeName, setRequiresTransientWeavedFields, setSelectionCall, setSelectionCriteria, setSelectionSQLString, setShouldExtendPessimisticLockScope, setUsesBatchReading, setUsesIndirection, shouldExtendPessimisticLockScope, shouldExtendPessimisticLockScopeInDedicatedQuery, shouldExtendPessimisticLockScopeInSourceQuery, shouldExtendPessimisticLockScopeInTargetQuery, shouldMergeCascadeParts, shouldRefreshCascadeParts, shouldUseBatchReading, trimRowForJoin, trimRowForJoin, useBasicIndirection, useBatchReading, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection, valueFromRow
-
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
addUnconvertedProperty, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, derivesId, earlyPreDelete, getAttributeAccessor, getAttributeClassification, getAttributeName, getDerivedIdMapping, getDescriptor, getField, getFieldClassification, getFields, getGetMethodName, getMapsIdValue, getProperties, getProperty, getRealAttributeValueFromObject, getSelectFields, getSelectTables, getSetMethodName, getUnconvertedProperties, getWeight, hasConstraintDependency, hasMapsIdValue, hasUnconvertedProperties, isAbstractColumnMapping, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCacheable, isCandidateForPrivateOwnedRemoval, isCloningRequired, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isElementCollectionMapping, isInAndOutSopObject, isInOnlySopObject, isInSopObject, isJPAId, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isMultitenantPrimaryKeyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToOneMapping, isOptional, isOutOnlySopObject, isOutSopObject, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isStructureMapping, isTransformationMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, readFromResultSetIntoObject, readOnly, readWrite, rehashFieldDependancies, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setDerivedIdMapping, setDerivesId, setDescriptor, setGetMethodName, setIsInAndOutSopObject, setIsInSopObject, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsOutSopObject, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setSetMethodName, setWeight, toString, validateAfterInitialization, valueFromObject, valueFromResultSet, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowForUpdateAfterShallowInsert, writeFromObjectIntoRowForUpdateBeforeShallowDelete, writeFromObjectIntoRowForWhereClause, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow, writeUpdateFieldsIntoRow
-
-
-
-
Method Detail
-
compareForChange
public org.eclipse.persistence.internal.sessions.ChangeRecord compareForChange(Object clone, 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:
compareForChangein classCollectionMapping- Returns:
- org.eclipse.persistence.internal.sessions.ChangeRecord
-
isOwned
public boolean isOwned()
INTERNAL:- Overrides:
isOwnedin classDatabaseMapping
-
isUnidirectionalOneToManyMapping
public boolean isUnidirectionalOneToManyMapping()
INTERNAL:- Overrides:
isUnidirectionalOneToManyMappingin classDatabaseMapping
-
initialize
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorExceptionINTERNAL: Initialize the mapping.- Overrides:
initializein classOneToManyMapping- 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:
postInitializein classCollectionMapping
-
preDelete
public void preDelete(DeleteObjectQuery query) throws DatabaseException, OptimisticLockException
INTERNAL: Delete the reference objects.- Overrides:
preDeletein classOneToManyMapping- Throws:
DatabaseExceptionOptimisticLockException
-
prepareCascadeLockingPolicy
public void prepareCascadeLockingPolicy()
Prepare a cascade locking policy.- Overrides:
prepareCascadeLockingPolicyin classOneToManyMapping
-
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:
postCalculateChangesin classCollectionMapping
-
postCalculateChangesOnDeleted
public void postCalculateChangesOnDeleted(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:
postCalculateChangesOnDeletedin classDatabaseMapping
-
recordPrivateOwnedRemovals
public void recordPrivateOwnedRemovals(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:
recordPrivateOwnedRemovalsin classCollectionMapping
-
requiresDataModificationEvents
public boolean requiresDataModificationEvents()
INTERNAL: UnidirectionalOneToManyMapping performs some events after INSERT/UPDATE to maintain the keys- Overrides:
requiresDataModificationEventsin classOneToManyMapping- 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).
-
-