EclipseLink 1.1.4, build 'v20100812-r7860' API Reference

org.eclipse.persistence.mappings
Class UnidirectionalOneToManyMapping

java.lang.Object
  extended by org.eclipse.persistence.mappings.DatabaseMapping
      extended by org.eclipse.persistence.mappings.ForeignReferenceMapping
          extended by org.eclipse.persistence.mappings.CollectionMapping
              extended by org.eclipse.persistence.mappings.OneToManyMapping
                  extended by 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.

See Also:
Serialized Form
Author:
Andrei Ilitchev
Since:
Eclipselink 1.1

Field Summary
protected  DataModifyQuery addTargetQuery
          Query used to update a single target row setting its foreign key to point to the source.
protected  boolean hasCustomAddTargetQuery
           
protected  boolean hasCustomPreDeleteQuery
           
protected  boolean hasCustomRemoveAllTargetsQuery
           
protected  boolean hasCustomRemoveTargetQuery
           
protected static java.lang.String ObjectAdded
           
protected static java.lang.String ObjectRemoved
           
protected static java.lang.String PostInsert
          Used for data modification events.
protected  DataModifyQuery preDeleteQuery
          Query used to update all target rows before the source object is deleted.
protected  DataModifyQuery removeAllTargetsQuery
          Query used to update all target rows changing target foreign key value from the one pointing to the source to null.
protected  DataModifyQuery removeTargetQuery
          Query used to update a single target row changing its foreign key value from the one pointing to the source to null.
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.
 
Fields inherited from class org.eclipse.persistence.mappings.OneToManyMapping
sourceKeyFields, sourceKeysToTargetForeignKeys, targetForeignKeyFields, targetForeignKeysToSourceKeys
 
Fields inherited from class org.eclipse.persistence.mappings.CollectionMapping
containerPolicy, deleteAllQuery, hasCustomDeleteAllQuery, hasOrderBy
 
Fields inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
cascadeMerge, cascadePersist, cascadeRefresh, cascadeRemove, forceInitializationOfSelectionCriteria, hasCustomSelectionQuery, indirectionPolicy, INNER_JOIN, isPrivateOwned, joinFetch, NONE, OUTER_JOIN, referenceClass, referenceClassName, referenceDescriptor, relationshipPartner, relationshipPartnerAttributeName, requiresTransientWeavedFields, selectionQuery, tempInitSession, usesBatchReading
 
Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping
attributeAccessor, attributeName, descriptor, fields, isLazy, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, NO_FIELDS, NO_WEIGHT, properties, weight, WEIGHT_1
 
Constructor Summary
UnidirectionalOneToManyMapping()
          PUBLIC: Default constructor.
 
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 session)
          INTERNAL: This method is used to create a change record from comparing two collections
protected  java.util.Vector extractPrimaryKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Extract the primary key value from the source row.
 java.lang.Object extractResultFromBatchQuery(DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord argumentRow)
          INTERNAL: Extract the value from the batch optimized query.
protected  java.util.Vector extractSourceKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Extract the source primary key value from the target row.
 void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Initialize the mapping.
protected  void initializeAddTargetQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Initialize addTargetQuery.
protected  void initializeRemoveAllTargetsQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Initialize removeAllTargetsQuery.
protected  void initializeRemoveTargetQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Initialize removeTargetQuery.
 boolean isUnidirectionalOneToManyMapping()
          INTERNAL:
protected  void objectAddedDuringUpdate(ObjectLevelModifyQuery query, java.lang.Object objectAdded, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet)
          INTERNAL: An object was added to the collection during an update, insert it if private.
protected  void objectRemovedDuringUpdate(ObjectLevelModifyQuery query, java.lang.Object objectDeleted)
          INTERNAL: An object was removed to the collection during an update, delete it if private.
 void performDataModificationEvent(java.lang.Object[] event, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Perform the commit event.
 void postCalculateChanges(ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractSession session)
          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.AbstractSession session)
          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 postInsert(WriteObjectQuery query)
          INTERNAL: Insert target foreign key into the reference table.
protected  void postPrepareNestedBatchQuery(ReadQuery batchQuery, ReadAllQuery query)
          INTERNAL: Add additional fields
 void postUpdate(WriteObjectQuery query)
          INTERNAL: Update the relation table with the entries related to this mapping.
 void preDelete(DeleteObjectQuery query)
          INTERNAL: Delete the reference objects.
 void prepareCascadeLockingPolicy()
          Prepare a cascade locking policy.
protected  void prepareTranslationRow(org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: The translation row may require additional fields than the primary key if the mapping in not on the primary key.
 void setAddTargetSQLString(java.lang.String sqlString)
          PUBLIC:
 void setCustomAddTargetQuery(DataModifyQuery query)
          PUBLIC: The default add target query for mapping can be overridden by specifying the new query.
 void setCustomRemoveAllTargetsQuery(DataModifyQuery query)
          PUBLIC: The default remove all targets query for mapping can be overridden by specifying the new query.
 void setCustomRemoveTargetQuery(DataModifyQuery query)
          PUBLIC: The default remove target query for mapping can be overridden by specifying the new query.
 void setSessionName(java.lang.String name)
          PUBLIC: Set the name of the session to execute the mapping's queries under.
 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).
 void updateTargetForeignKeyPostUpdateSource_ObjectAdded(ObjectLevelModifyQuery query, java.lang.Object objectAdded)
          INTERNAL: Update target foreign key after a target object was added to the source.
 void updateTargetForeignKeyPostUpdateSource_ObjectRemoved(ObjectLevelModifyQuery query, java.lang.Object objectRemoved)
          INTERNAL: Update target foreign key after a target object was removed from the source.
 void updateTargetForeignKeyPreDeleteSource(ObjectLevelModifyQuery query)
          INTERNAL: Update target foreign key after a target object was removed from the source.
 void updateTargetForeignKeysPostInsertSource(WriteObjectQuery query)
          INTERNAL: Update target foreign keys after a new source was inserted.
 
Methods inherited from class org.eclipse.persistence.mappings.OneToManyMapping
addTargetForeignKeyField, addTargetForeignKeyFieldName, buildDefaultSelectionCriteria, buildSelectionCriteria, clone, deleteAll, deleteReferenceObjectsLeftOnDatabase, executeBatchQuery, extractForeignKeyFromReferenceObject, extractKeyFromRow, getSourceKeyFieldNames, getSourceKeyFields, getSourceKeysToTargetForeignKeys, getTargetForeignKeyFieldNames, getTargetForeignKeyFields, getTargetForeignKeysToSourceKeys, getTargetForeignKeyToSourceKeys, hasInverseConstraintDependency, initializeDeleteAllQuery, initializeTargetForeignKeysToSourceKeys, isCascadedLockingSupported, isJoiningSupported, isOneToManyMapping, isRelationalMapping, isSourceKeySpecified, setDeleteAllSQLString, setSourceKeyFieldNames, setSourceKeyFields, setTargetForeignKeyFieldName, setTargetForeignKeyFieldNames, setTargetForeignKeyFieldNames, setTargetForeignKeyFields, setTargetForeignKeysToSourceKeys, shouldObjectModifyCascadeToParts, verifyDelete
 
Methods inherited from class org.eclipse.persistence.mappings.CollectionMapping
addAggregateOrderBy, addAscendingOrdering, addDescendingOrdering, addOrderBy, addToCollectionChangeRecord, buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildCopy, buildElementClone, buildReferencesPKList, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadeMerge, cascadePerformRemoveIfRequired, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cascadeRegisterNewIfRequired, compareCollectionsForChange, compareObjects, compareObjectsAndWrite, compareObjectsWithoutPrivateOwned, compareObjectsWithPrivateOwned, convertClassNamesToClasses, fixRealObjectReferences, getContainerPolicy, getDeleteAllQuery, getObjectCorrespondingTo, getOrderByQueryKeyExpressions, getRealCollectionAttributeValueFromObject, hasCustomDeleteAllQuery, hasOrderBy, isAttributeValueInstantiatedOrChanged, isChangeTrackingSupported, isCollectionMapping, iterateOnElement, iterateOnRealAttributeValue, mergeChangesIntoObject, mergeIntoObject, mustDeleteReferenceObjectsOneByOne, objectUnchangedDuringUpdate, objectUnchangedDuringUpdate, readPrivateOwnedForObject, removeFromCollectionChangeRecord, replaceValueHoldersIn, setChangeListener, setContainerPolicy, setCustomDeleteAllQuery, setDeleteAllCall, setDeleteAllQuery, setHasCustomDeleteAllQuery, setSelectionQueryContainerPolicy, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, updateChangeRecord, updateCollectionChangeRecord, useCollectionClass, useCollectionClassName, useListClassName, useMapClass, useMapClass, useMapClassName, useSortedSetClass, useSortedSetClassName, useSortedSetClassName, useTransparentCollection, useTransparentList, useTransparentMap, useTransparentSet, validateBeforeInitialization, valueFromPKList, valueFromRowInternalWithJoin
 
Methods inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
batchedValueFromRow, buildBackupClone, buildClone, buildCloneFromRow, createUnitOfWorkValueHolder, dontDoMerge, dontUseBatchReading, dontUseIndirection, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getBatchReadObjects, getIndirectionPolicy, getJoinCriteria, getJoinFetch, getRealAttributeValueFromAttribute, getReferenceClass, getReferenceClassName, getReferenceDescriptor, getRelationshipPartner, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getTempSession, getValueFromRemoteValueHolder, hasCustomSelectionQuery, initializeReferenceDescriptor, initializeSelectionQuery, instantiateAttribute, isAttributeValueInstantiated, isCascadeMerge, isCascadePersist, isCascadeRefresh, isCascadeRemove, isForeignReferenceMapping, isInnerJoinFetched, isJoinFetched, isLazy, isOuterJoinFetched, isPrivateOwned, iterate, mergeRemoteValueHolder, preInitialize, prepareHistoricalQuery, prepareNestedBatchQuery, prepareNestedJoinQueryClone, prepareNestedJoins, privateOwnedRelationship, remoteInitialization, requiresTransientWeavedFields, setBatchReadObjects, setCascadeAll, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setForceInitializationOfSelectionCriteria, setHasCustomSelectionQuery, setIndirectionPolicy, setIsPrivateOwned, setJoinFetch, setRealAttributeValueInObject, setReferenceClass, setReferenceClassName, setReferenceDescriptor, setRelationshipPartner, setRelationshipPartnerAttributeName, setRequiresTransientWeavedFields, setSelectionCall, setSelectionCriteria, setSelectionQuery, setSelectionSQLString, setTempSession, setUsesBatchReading, setUsesIndirection, shouldForceInitializationOfSelectionCriteria, shouldInitializeSelectionCriteria, shouldMergeCascadeParts, shouldMergeCascadeReference, shouldUseBatchReading, shouldUseValueFromRowWithJoin, trimRowForJoin, trimRowForJoin, useBasicIndirection, useBatchReading, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection, valueFromRow, valueFromRowInternal
 
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
buildExpression, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, cloneFields, collectFields, extractNestedExpressions, getAttributeAccessor, getAttributeClassification, getAttributeName, getDescriptor, getField, getFieldClassification, getFields, getGetMethodName, getProperties, getProperty, getRealAttributeValueFromObject, getSelectFields, getSelectTables, getSetMethodName, getWeight, hasConstraintDependency, hasDependency, hasRootExpressionThatShouldUseOuterJoin, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCandidateForPrivateOwnedRemoval, isCloningRequired, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isManyToManyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToOneMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, postDelete, preInsert, preUpdate, readFromResultSetIntoObject, readFromRowIntoObject, readOnly, readWrite, rehashFieldDependancies, remotelyInitialized, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setDescriptor, setFields, setGetMethodName, setIsLazy, setIsOptional, setIsPrimaryKeyMapping, setIsReadOnly, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PostInsert

protected static final java.lang.String PostInsert
Used for data modification events.

See Also:
Constant Field Values

ObjectRemoved

protected static final java.lang.String ObjectRemoved
See Also:
Constant Field Values

ObjectAdded

protected static final java.lang.String ObjectAdded
See Also:
Constant Field Values

preDeleteQuery

protected transient DataModifyQuery preDeleteQuery
Query used to update all target rows before the source object is deleted.


hasCustomPreDeleteQuery

protected transient boolean hasCustomPreDeleteQuery

addTargetQuery

protected transient DataModifyQuery addTargetQuery
Query used to update a single target row setting its foreign key to point to the source. Run once for each target added to the source. Example: for Employee with managedEmployees attribute mapped with UnidirectionalOneToMany the query looks like: UPDATE EMPLOYEE SET MANAGER_ID = 1 WHERE (EMP_ID = 2) where 1 is id of the source, and 2 is the id of the target to be added.


hasCustomAddTargetQuery

protected transient boolean hasCustomAddTargetQuery

removeTargetQuery

protected transient DataModifyQuery removeTargetQuery
Query used to update a single target row changing its foreign key value from the one pointing to the source to null. Run once for each target removed from the source. Example: for Employee with managedEmployees attribute mapped with UnidirectionalOneToMany the query looks like: UPDATE EMPLOYEE SET MANAGER_ID = null WHERE ((MANAGER_ID = 1) AND (EMP_ID = 2)) where 1 is id of the source, and 2 is the id of the target to be removed.


hasCustomRemoveTargetQuery

protected transient boolean hasCustomRemoveTargetQuery

removeAllTargetsQuery

protected transient DataModifyQuery removeAllTargetsQuery
Query used to update all target rows changing target foreign key value from the one pointing to the source to null. Run before the source object is deleted. Example: for Employee with managedEmployees attribute mapped with UnidirectionalOneToMany the query looks like: UPDATE EMPLOYEE SET MANAGER_ID = null WHERE (MANAGER_ID = 1) where 1 is id of the source to be deleted.


hasCustomRemoveAllTargetsQuery

protected transient boolean hasCustomRemoveAllTargetsQuery

shouldIncrementTargetLockValueOnAddOrRemoveTarget

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


shouldIncrementTargetLockValueOnDeleteSource

protected transient 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

UnidirectionalOneToManyMapping

public UnidirectionalOneToManyMapping()
PUBLIC: Default constructor.

Method Detail

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 session)
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

extractPrimaryKeyFromRow

protected java.util.Vector extractPrimaryKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                                    org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Extract the primary key value from the source row. Used for batch reading, most following same order and fields as in the mapping.


extractSourceKeyFromRow

protected java.util.Vector extractSourceKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                                   org.eclipse.persistence.internal.sessions.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.


extractResultFromBatchQuery

public java.lang.Object extractResultFromBatchQuery(DatabaseQuery query,
                                                    org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
                                                    org.eclipse.persistence.internal.sessions.AbstractSession session,
                                                    org.eclipse.persistence.internal.sessions.AbstractRecord argumentRow)
INTERNAL: Extract the value from the batch optimized query.

Overrides:
extractResultFromBatchQuery in class OneToManyMapping

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 DatabaseMapping

initializeAddTargetQuery

protected void initializeAddTargetQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Initialize addTargetQuery.


initializeRemoveTargetQuery

protected void initializeRemoveTargetQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Initialize removeTargetQuery.


initializeRemoveAllTargetsQuery

protected void initializeRemoveAllTargetsQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Initialize removeAllTargetsQuery.


objectAddedDuringUpdate

protected void objectAddedDuringUpdate(ObjectLevelModifyQuery query,
                                       java.lang.Object objectAdded,
                                       org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet)
                                throws DatabaseException,
                                       OptimisticLockException
INTERNAL: An object was added to the collection during an update, insert it if private.

Overrides:
objectAddedDuringUpdate in class CollectionMapping
Throws:
DatabaseException
OptimisticLockException

objectRemovedDuringUpdate

protected void objectRemovedDuringUpdate(ObjectLevelModifyQuery query,
                                         java.lang.Object objectDeleted)
                                  throws DatabaseException,
                                         OptimisticLockException
INTERNAL: An object was removed to the collection during an update, delete it if private.

Overrides:
objectRemovedDuringUpdate in class CollectionMapping
Throws:
DatabaseException
OptimisticLockException

performDataModificationEvent

public void performDataModificationEvent(java.lang.Object[] event,
                                         org.eclipse.persistence.internal.sessions.AbstractSession session)
                                  throws DatabaseException,
                                         DescriptorException
INTERNAL: Perform the commit event. This is used in the uow to delay data modifications.

Overrides:
performDataModificationEvent in class DatabaseMapping
Throws:
DatabaseException
DescriptorException

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.AbstractSession session)
INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.

Overrides:
postCalculateChanges in class DatabaseMapping

postCalculateChangesOnDeleted

public void postCalculateChangesOnDeleted(java.lang.Object deletedObject,
                                          org.eclipse.persistence.internal.sessions.UnitOfWorkChangeSet uowChangeSet,
                                          org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Overridden by mappings that require objects to be deleted contribute to change set creation.

Overrides:
postCalculateChangesOnDeleted in class DatabaseMapping

postInsert

public void postInsert(WriteObjectQuery query)
                throws DatabaseException
INTERNAL: Insert target foreign key into the reference table. This follows following steps.

- Extract primary key and its value from the source object.

- Extract target key and its value from the target object.

- Construct a insert statement with above fields and values for relation table.

- execute the statement.

- Repeat above three statements until all the target objects are done.

Overrides:
postInsert in class OneToManyMapping
Throws:
DatabaseException

postPrepareNestedBatchQuery

protected void postPrepareNestedBatchQuery(ReadQuery batchQuery,
                                           ReadAllQuery query)
INTERNAL: Add additional fields

Overrides:
postPrepareNestedBatchQuery in class ForeignReferenceMapping

postUpdate

public void postUpdate(WriteObjectQuery query)
                throws DatabaseException
INTERNAL: Update the relation table with the entries related to this mapping. Delete entries removed, insert entries added. If private also insert/delete/update target objects.

Overrides:
postUpdate in class OneToManyMapping
Throws:
DatabaseException

prepareTranslationRow

protected void prepareTranslationRow(org.eclipse.persistence.internal.sessions.AbstractRecord translationRow,
                                     java.lang.Object object,
                                     org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: The translation row may require additional fields than the primary key if the mapping in not on the primary key.

Overrides:
prepareTranslationRow in class CollectionMapping

setAddTargetSQLString

public void setAddTargetSQLString(java.lang.String sqlString)
PUBLIC:


setCustomAddTargetQuery

public void setCustomAddTargetQuery(DataModifyQuery query)
PUBLIC: The default add target query for mapping can be overridden by specifying the new query. This query must set new value to target foreign key.


setCustomRemoveTargetQuery

public void setCustomRemoveTargetQuery(DataModifyQuery query)
PUBLIC: The default remove target query for mapping can be overridden by specifying the new query. In case target foreign key references the source, this query must set target foreign key to null.


setCustomRemoveAllTargetsQuery

public void setCustomRemoveAllTargetsQuery(DataModifyQuery query)
PUBLIC: The default remove all targets query for mapping can be overridden by specifying the new query. This query must set all target foreign keys that reference the source to null.


setSessionName

public void setSessionName(java.lang.String name)
PUBLIC: Set the name of the session to execute the mapping's queries under. This can be used by the session broker to override the default session to be used for the target class.

Overrides:
setSessionName in class CollectionMapping

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).


updateTargetForeignKeysPostInsertSource

public void updateTargetForeignKeysPostInsertSource(WriteObjectQuery query)
                                             throws DatabaseException
INTERNAL: Update target foreign keys after a new source was inserted. This follows following steps.

- Extract primary key and its value from the source object.

- Extract target key and its value from the target object.

- Construct an update statement with above fields and values for target table.

- execute the statement.

- Repeat above three statements until all the target objects are done.

Throws:
DatabaseException

updateTargetForeignKeyPostUpdateSource_ObjectAdded

public void updateTargetForeignKeyPostUpdateSource_ObjectAdded(ObjectLevelModifyQuery query,
                                                               java.lang.Object objectAdded)
                                                        throws DatabaseException
INTERNAL: Update target foreign key after a target object was added to the source. This follows following steps.

- Extract primary key and its value from the source object.

- Extract target key and its value from the target object.

- Construct an update statement with above fields and values for target table.

- execute the statement.

Throws:
DatabaseException

updateTargetForeignKeyPostUpdateSource_ObjectRemoved

public void updateTargetForeignKeyPostUpdateSource_ObjectRemoved(ObjectLevelModifyQuery query,
                                                                 java.lang.Object objectRemoved)
                                                          throws DatabaseException
INTERNAL: Update target foreign key after a target object was removed from the source. This follows following steps.

- Extract primary key and its value from the source object.

- Extract target key and its value from the target object.

- Construct an update statement with above fields and values for target table.

- execute the statement.

Throws:
DatabaseException

updateTargetForeignKeyPreDeleteSource

public void updateTargetForeignKeyPreDeleteSource(ObjectLevelModifyQuery query)
                                           throws DatabaseException
INTERNAL: Update target foreign key after a target object was removed from the source. This follows following steps.

- Extract primary key and its value from the source object.

- Extract target key and its value from the target object.

- Construct an update statement with above fields and values for target table.

- execute the statement.

Throws:
DatabaseException

EclipseLink 1.1.4, build 'v20100812-r7860' API Reference