EclipseLink 2.0.0, build 'v20091127-r5931' API Reference

org.eclipse.persistence.eis.mappings
Class EISOneToManyMapping

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.eis.mappings.EISOneToManyMapping
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, EISMapping, ContainerMapping

public class EISOneToManyMapping
extends CollectionMapping
implements EISMapping

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

See Also:
EISDescriptor.useIndexedRecordFormat(), EISDescriptor.useMappedRecordFormat(), EISDescriptor.useXMLRecordFormat(), Serialized Form
Since:
Oracle TopLink 10g Release 2 (10.1.3)

Field Summary
protected  XMLField foreignKeyGroupingElement
          The grouping-element field.
protected  boolean isForeignKeyRelationship
          Keeps track if any of the fields are foreign keys.
protected  java.util.List sourceForeignKeyFields
          The (typically primary) source key fields that are referenced by the targetForeignKeyFields.
protected  java.util.Map sourceForeignKeysToTargetKeys
          This maps the source foreign key fields to the corresponding (primary) target key fields.
protected  java.util.List targetForeignKeyFields
          The target foreign key fields that reference the sourceKeyFields.
 
Fields inherited from class org.eclipse.persistence.mappings.CollectionMapping
changeOrderTargetQuery, containerPolicy, deleteAllQuery, hasCustomDeleteAllQuery, hasOrderBy, isListOrderFieldSupported, listOrderField, orderCorrectionType
 
Fields inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
cascadeDetach, 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, derivedIdMapping, derivesId, descriptor, fields, isJPAId, isLazy, isMapKeyMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, mapsIdValue, NO_FIELDS, NO_WEIGHT, properties, weight, WEIGHT_1
 
Constructor Summary
EISOneToManyMapping()
           
 
Method Summary
 void addAscendingOrdering(java.lang.String queryKeyName)
          INTERNAL: This method is not supported in an EIS environment.
 void addDescendingOrdering(java.lang.String queryKeyName)
          INTERNAL: This method is not supported in an EIS environment.
 void addForeignKeyField(org.eclipse.persistence.internal.helper.DatabaseField sourceForeignKeyField, org.eclipse.persistence.internal.helper.DatabaseField targetKeyField)
          PUBLIC: Define the source foreign key relationship in the one-to-many mapping.
 void addForeignKeyFieldName(java.lang.String sourceForeignKeyFieldName, java.lang.String targetKeyFieldName)
          PUBLIC: Define the source foreign key relationship in the one-to-many mapping.
 java.lang.Object buildAddedElementFromChangeSet(java.lang.Object changeSet, org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
          INTERNAL: Build and return a new element based on the change set.
 java.lang.Object buildChangeSet(java.lang.Object element, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Build and return a change set for the specified element.
protected  java.lang.Object buildElementFromChangeSet(java.lang.Object changeSet, org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
          Build and return a new element based on the change set.
 java.lang.Object buildElementFromElement(java.lang.Object element, org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
          INTERNAL: Build and return a new element based on the specified element.
 java.lang.Object buildRemovedElementFromChangeSet(java.lang.Object changeSet, org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
          INTERNAL: Build and return a new element based on the change set.
 java.lang.Object clone()
          INTERNAL: Clone the appropriate attributes.
protected  java.util.Vector collectFields()
          Return all the fields mapped by the mapping.
 boolean compareElements(java.lang.Object element1, java.lang.Object element2, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Compare the non-null elements and return true if they are alike.
 boolean compareElementsForChange(java.lang.Object element1, java.lang.Object element2, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Compare the non-null elements and return true if they are alike.
 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: Compare the changes between two collections.
 boolean compareObjects(java.lang.Object object1, java.lang.Object object2, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Compare the attributes belonging to this mapping for the objects.
protected  void deleteAll(DeleteObjectQuery query)
          Delete all the reference objects.
protected  void deleteAll(DeleteObjectQuery query, java.lang.Object referenceObjects)
          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.
 void dontUseBatchReading()
          INTERNAL: This method is not supported in an EIS environment.
protected  java.lang.Object executeBatchQueryForPessimisticLocking(DatabaseQuery query, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractRecord argumentRow)
          INTERNAL: This method is not supported in an EIS environment.
protected  XMLRecord extractKeyRowFromReferenceObject(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session, XMLRecord parentRecord)
          Build and return a database row that contains a foreign key for the specified reference object.
 ModifyQuery getDeleteAllQuery()
           
 XMLField getForeignKeyGroupingElement()
          Get the grouping element field on the mapping.
 java.util.Vector getForeignKeyRows(org.eclipse.persistence.internal.sessions.AbstractRecord row)
          INTERNAL:
 java.util.List getSourceForeignKeyFields()
          INTERNAL: Return the source foreign key fields.
 java.util.Map getSourceForeignKeysToTargetKeys()
          INTERNAL: Sets the target foreign key fields.
 java.util.List getTargetForeignKeyFields()
          INTERNAL: Return the source foreign key fields.
 boolean hasCustomDeleteAllQuery()
           
 boolean hasInverseConstraintDependency()
          INTERNAL: Return whether the mapping has any inverse constraint dependencies, such as foreign keys.
 void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Initialize the mapping.
protected  void initializeDeleteAllQuery()
          Initialize the delete all query.
protected  void initializeSourceForeignKeysToTargetKeys()
           
 boolean isEISMapping()
          INTERNAL:
 boolean isForeignKeyRelationship()
          INTERNAL: Return if the 1-M mapping has a foreign key dependency to its target.
 boolean mapKeyHasChanged(java.lang.Object element, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Return whether the element's user-defined Map key has changed since it was cloned from the original version.
protected  boolean mustDeleteReferenceObjectsOneByOne()
          Return whether the reference objects must be deleted one by one, as opposed to with a single DELETE statement.
 void postDelete(DeleteObjectQuery query)
          INTERNAL: Delete the reference objects.
 void postInsert(WriteObjectQuery query)
          INTERNAL: Insert the reference objects.
 void postUpdate(WriteObjectQuery query)
          INTERNAL: Update the reference objects.
 void preDelete(DeleteObjectQuery query)
          INTERNAL: Delete the reference objects.
 void preInsert(WriteObjectQuery query)
          INTERNAL: Insert privately owned parts
 void preUpdate(WriteObjectQuery query)
          INTERNAL: Update the privately owned parts.
 void setDeleteAllCall(Call call)
          PUBLIC: The default delete all call for this mapping can be overridden by specifying the new call.
 void setDeleteAllSQLString(java.lang.String sqlString)
          INTERNAL: This method is not supported in an EIS environment.
 void setForeignKeyGroupingElement(java.lang.String xpath)
          Set the grouping element field on the mapping.
 void setForeignKeyGroupingElement(XMLField field)
          Set if the grouping element field on the mapping.
 void setIsForeignKeyRelationship(boolean isForeignKeyRelationship)
          INTERNAL: Set if the 1-M mapping has a foreign key dependency to its target.
 void setSelectionCriteria(Expression anExpression)
          INTERNAL: This method is not supported in an EIS environment.
 void setSelectionSQLString(java.lang.String sqlString)
          INTERNAL: This method is not supported in an EIS environment.
 void setSourceForeignKeyFields(java.util.List fields)
          INTERNAL: Sets the source foreign key fields.
 void setSourceForeignKeysToTargetKeys(java.util.Map sourceToTargetKeyFields)
          INTERNAL: Set the source keys to target keys fields association.
 void setTargetForeignKeyFields(java.util.List fields)
          INTERNAL: Sets the target foreign key fields.
 void setUsesBatchReading(boolean usesBatchReading)
          INTERNAL: This method is not supported in an EIS environment.
protected  boolean shouldObjectModifyCascadeToParts(ObjectLevelModifyQuery query)
          Return whether any process leading to object modification should also affect its parts.
 boolean shouldUseBatchReading()
          INTERNAL: This method is not supported in an EIS environment.
 void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object changeSetToAdd, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.AbstractSession session)
          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.
 void simpleRemoveFromCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object changeSetToRemove, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.AbstractSession session)
          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.
 void useBatchReading()
          INTERNAL: This method is not supported in an EIS environment.
 java.lang.Object valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
          INTERNAL: Return the value of the reference attribute or a value holder.
 boolean verifyDelete(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Used to verify whether the specified object is deleted or not.
 void writeFromObjectIntoRow(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Get the appropriate attribute value from the object and put it in the appropriate field of the database row.
 void writeFromObjectIntoRowForShallowInsert(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts.
 void writeFromObjectIntoRowForShallowInsertWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts.
 void writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery, org.eclipse.persistence.internal.sessions.AbstractRecord row)
          INTERNAL: If any of the references objects has changed, write out all the keys.
 void writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Get the appropriate attribute value from the object and put it in the appropriate field of the database row.
 void writeInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Write fields needed for insert into the template for with null values.
 
Methods inherited from class org.eclipse.persistence.mappings.CollectionMapping
addAggregateOrderBy, addOrderBy, buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildCopy, buildElementClone, buildListOrderField, buildReferencesPKList, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadeMerge, cascadePerformRemoveIfRequired, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cascadeRegisterNewIfRequired, compareCollectionsForChange, compareLists, compareListsAndWrite, compareObjectsAndWrite, compareObjectsWithoutPrivateOwned, compareObjectsWithPrivateOwned, convertClassNamesToClasses, extractKeyFromTargetRow, extractPrimaryKeyFromRow, extractResultFromBatchQuery, fixRealObjectReferences, getContainerPolicy, getJoinCriteria, getListOrderField, getListOrderFieldExpression, getObjectCorrespondingTo, getOrderByQueryKeyExpressions, getOrderCorrectionType, getRealCollectionAttributeValueFromObject, getSelectionQueryContainerPolicy, getTargetPrimaryKeyFields, hasOrderBy, initializeChangeOrderTargetQuery, initializeListOrderField, initializeListOrderFieldTable, isAttributeValueInstantiatedOrChanged, isChangeTrackingSupported, isCollectionMapping, isListOrderFieldSupported, iterateOnElement, iterateOnRealAttributeValue, mergeChangesForCollectionMembers, mergeChangesIntoObject, mergeIntoObject, objectAddedDuringUpdate, objectOrderChangedDuringUpdate, objectRemovedDuringUpdate, objectUnchangedDuringUpdate, objectUnchangedDuringUpdate, postCalculateChanges, postInitialize, prepareNestedBatchQuery, prepareTranslationRow, readPrivateOwnedForObject, recordPrivateOwnedRemovals, replaceValueHoldersIn, setChangeListener, setContainerPolicy, setCustomDeleteAllQuery, setDeleteAllQuery, setHasCustomDeleteAllQuery, setListOrderField, setListOrderFieldName, setOrderCorrectionType, setSelectionQueryContainerPolicy, setSessionName, shouldUseListOrderFieldTableExpression, 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, dontUseIndirection, extendPessimisticLockScopeInSourceQuery, extendPessimisticLockScopeInTargetQuery, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getBatchReadObjects, getExtendPessimisticLockScopeDedicatedQuery, getIndirectionPolicy, getJoinFetch, getRealAttributeValueFromAttribute, getReferenceClass, getReferenceClassName, getReferenceDescriptor, getRelationshipPartner, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getTempSession, getValueFromRemoteValueHolder, hasCustomSelectionQuery, initializeReferenceDescriptor, initializeSelectionQuery, instantiateAttribute, isAttributeValueInstantiated, isCascadeDetach, isCascadeMerge, isCascadePersist, isCascadeRefresh, isCascadeRemove, isExtendingPessimisticLockScope, isForeignReferenceMapping, isInnerJoinFetched, isJoinFetched, isJoiningSupported, isLazy, isLockableMapping, isOuterJoinFetched, isPrivateOwned, iterate, mergeRemoteValueHolder, postPrepareNestedBatchQuery, preInitialize, prepareHistoricalQuery, prepareNestedJoinQueryClone, prepareNestedJoins, privateOwnedRelationship, remoteInitialization, requiresTransientWeavedFields, setBatchReadObjects, setCascadeAll, setCascadeDetach, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setForceInitializationOfSelectionCriteria, setHasCustomSelectionQuery, setIndirectionPolicy, setIsPrivateOwned, setJoinFetch, setRealAttributeValueInObject, setReferenceClass, setReferenceClassName, setReferenceDescriptor, setRelationshipPartner, setRelationshipPartnerAttributeName, setRequiresTransientWeavedFields, setSelectionCall, setSelectionQuery, setShouldExtendPessimisticLockScope, setTempSession, setUsesIndirection, shouldExtendPessimisticLockScope, shouldExtendPessimisticLockScopeInDedicatedQuery, shouldExtendPessimisticLockScopeInSourceQuery, shouldExtendPessimisticLockScopeInTargetQuery, shouldForceInitializationOfSelectionCriteria, shouldInitializeSelectionCriteria, shouldMergeCascadeParts, shouldMergeCascadeReference, shouldUseValueFromRowWithJoin, trimRowForJoin, trimRowForJoin, useBasicIndirection, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection, valueFromRowInternal
 
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
buildExpression, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, cloneFields, derivesId, earlyPreDelete, extractNestedExpressions, getAttributeAccessor, getAttributeClassification, getAttributeName, getDerivedIdMapping, getDescriptor, getField, getFieldClassification, getFields, getGetMethodName, getMapsIdValue, getProperties, getProperty, getRealAttributeValueFromObject, getSelectFields, getSelectTables, getSetMethodName, getWeight, hasConstraintDependency, hasDependency, hasMapsIdValue, hasRootExpressionThatShouldUseOuterJoin, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isCloningRequired, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isJPAId, isManyToManyMapping, isMapKeyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOwned, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isRelationalMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, performDataModificationEvent, postCalculateChangesOnDeleted, prepareCascadeLockingPolicy, readFromResultSetIntoObject, readFromRowIntoObject, readOnly, readWrite, rehashFieldDependancies, remotelyInitialized, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setDerivedIdMapping, setDerivesId, setDescriptor, setFields, setGetMethodName, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setSetMethodName, setWeight, toString, validateAfterInitialization, valueFromObject, valueFromResultSet, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRowForWhereClause, writeUpdateFieldsIntoRow
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isForeignKeyRelationship

protected boolean isForeignKeyRelationship
Keeps track if any of the fields are foreign keys.


targetForeignKeyFields

protected transient java.util.List targetForeignKeyFields
The target foreign key fields that reference the sourceKeyFields.


sourceForeignKeyFields

protected transient java.util.List sourceForeignKeyFields
The (typically primary) source key fields that are referenced by the targetForeignKeyFields.


sourceForeignKeysToTargetKeys

protected transient java.util.Map sourceForeignKeysToTargetKeys
This maps the source foreign key fields to the corresponding (primary) target key fields.


foreignKeyGroupingElement

protected XMLField foreignKeyGroupingElement
The grouping-element field.

Constructor Detail

EISOneToManyMapping

public EISOneToManyMapping()
Method Detail

isEISMapping

public boolean isEISMapping()
INTERNAL:

Overrides:
isEISMapping in class DatabaseMapping

addForeignKeyField

public void addForeignKeyField(org.eclipse.persistence.internal.helper.DatabaseField sourceForeignKeyField,
                               org.eclipse.persistence.internal.helper.DatabaseField targetKeyField)
PUBLIC: Define the source foreign key relationship in the one-to-many mapping. This method is used for composite source foreign key relationships. That is, the source object's table has multiple foreign key fields that are references to the target object's (typically primary) key fields. Both the source foreign key field name and the corresponding target primary key field name must be specified.


addForeignKeyFieldName

public void addForeignKeyFieldName(java.lang.String sourceForeignKeyFieldName,
                                   java.lang.String targetKeyFieldName)
PUBLIC: Define the source foreign key relationship in the one-to-many mapping. This method is used for composite source foreign key relationships. That is, the source object's table has multiple foreign key fields that are references to the target object's (typically primary) key fields. Both the source foreign key field name and the corresponding target primary key field name must be specified.


isForeignKeyRelationship

public boolean isForeignKeyRelationship()
INTERNAL: Return if the 1-M mapping has a foreign key dependency to its target. This is true if any of the foreign key fields are true foreign keys, i.e. populated on write from the targets primary key.


setIsForeignKeyRelationship

public void setIsForeignKeyRelationship(boolean isForeignKeyRelationship)
INTERNAL: Set if the 1-M mapping has a foreign key dependency to its target. This is true if any of the foreign key fields are true foreign keys, i.e. populated on write from the targets primary key.


getForeignKeyGroupingElement

public XMLField getForeignKeyGroupingElement()
Get the grouping element field on the mapping. This is an optional setting.


setForeignKeyGroupingElement

public void setForeignKeyGroupingElement(java.lang.String xpath)
Set the grouping element field on the mapping. This is an optional setting; however it is a required setting when there are more than one foreign keys specified


hasCustomDeleteAllQuery

public boolean hasCustomDeleteAllQuery()
Overrides:
hasCustomDeleteAllQuery in class CollectionMapping

getDeleteAllQuery

public ModifyQuery getDeleteAllQuery()
Overrides:
getDeleteAllQuery in class CollectionMapping

setDeleteAllCall

public void setDeleteAllCall(Call call)
PUBLIC: The default delete all call for this mapping can be overridden by specifying the new call. This call is responsible for doing the deletion required by the mapping, such as optimized delete all of target objects for 1-M.

Overrides:
setDeleteAllCall in class CollectionMapping

setForeignKeyGroupingElement

public void setForeignKeyGroupingElement(XMLField field)
Set if the grouping element field on the mapping. This is an optional setting; however it is a required setting when there are more than one foreign keys specified.


getSourceForeignKeyFields

public java.util.List getSourceForeignKeyFields()
INTERNAL: Return the source foreign key fields.


setSourceForeignKeyFields

public void setSourceForeignKeyFields(java.util.List fields)
INTERNAL: Sets the source foreign key fields.


getTargetForeignKeyFields

public java.util.List getTargetForeignKeyFields()
INTERNAL: Return the source foreign key fields.


setTargetForeignKeyFields

public void setTargetForeignKeyFields(java.util.List fields)
INTERNAL: Sets the target foreign key fields.


getSourceForeignKeysToTargetKeys

public java.util.Map getSourceForeignKeysToTargetKeys()
INTERNAL: Sets the target foreign key fields.


setSourceForeignKeysToTargetKeys

public void setSourceForeignKeysToTargetKeys(java.util.Map sourceToTargetKeyFields)
INTERNAL: Set the source keys to target keys fields association.


hasInverseConstraintDependency

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

Overrides:
hasInverseConstraintDependency in class DatabaseMapping

initialize

public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
                throws DescriptorException
INTERNAL: Initialize the mapping.

Overrides:
initialize in class CollectionMapping
Throws:
DescriptorException

initializeSourceForeignKeysToTargetKeys

protected void initializeSourceForeignKeysToTargetKeys()
                                                throws DescriptorException
Throws:
DescriptorException

initializeDeleteAllQuery

protected void initializeDeleteAllQuery()
Initialize the delete all query. This query is used to delete the collection of objects from the database.


mustDeleteReferenceObjectsOneByOne

protected boolean mustDeleteReferenceObjectsOneByOne()
Return whether the reference objects must be deleted one by one, as opposed to with a single DELETE statement.

Overrides:
mustDeleteReferenceObjectsOneByOne in class CollectionMapping

shouldObjectModifyCascadeToParts

protected boolean shouldObjectModifyCascadeToParts(ObjectLevelModifyQuery query)
Return whether any process leading to object modification should also affect its parts. Used by write, insert, update, and delete.

Overrides:
shouldObjectModifyCascadeToParts in class ForeignReferenceMapping

verifyDelete

public boolean verifyDelete(java.lang.Object object,
                            org.eclipse.persistence.internal.sessions.AbstractSession session)
                     throws DatabaseException
INTERNAL: Used to verify whether the specified object is deleted or not.

Overrides:
verifyDelete in class CollectionMapping
Throws:
DatabaseException

postInsert

public void postInsert(WriteObjectQuery query)
                throws DatabaseException,
                       OptimisticLockException
INTERNAL: Insert the reference objects.

Overrides:
postInsert in class CollectionMapping
Throws:
DatabaseException
OptimisticLockException

postUpdate

public void postUpdate(WriteObjectQuery query)
                throws DatabaseException,
                       OptimisticLockException
INTERNAL: Update the reference objects.

Overrides:
postUpdate in class DatabaseMapping
Throws:
DatabaseException
OptimisticLockException

postDelete

public void postDelete(DeleteObjectQuery query)
                throws DatabaseException,
                       OptimisticLockException
INTERNAL: Delete the reference objects.

Overrides:
postDelete in class CollectionMapping
Throws:
DatabaseException
OptimisticLockException

preDelete

public void preDelete(DeleteObjectQuery query)
               throws DatabaseException,
                      OptimisticLockException
INTERNAL: Delete the reference objects.

Overrides:
preDelete in class DatabaseMapping
Throws:
DatabaseException
OptimisticLockException

preInsert

public void preInsert(WriteObjectQuery query)
               throws DatabaseException,
                      OptimisticLockException
INTERNAL: Insert privately owned parts

Overrides:
preInsert in class CollectionMapping
Throws:
DatabaseException
OptimisticLockException

preUpdate

public void preUpdate(WriteObjectQuery query)
               throws DatabaseException,
                      OptimisticLockException
INTERNAL: Update the privately owned parts.

Overrides:
preUpdate in class CollectionMapping
Throws:
DatabaseException
OptimisticLockException

buildAddedElementFromChangeSet

public java.lang.Object buildAddedElementFromChangeSet(java.lang.Object changeSet,
                                                       org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
INTERNAL: Build and return a new element based on the change set.


buildChangeSet

public java.lang.Object buildChangeSet(java.lang.Object element,
                                       org.eclipse.persistence.internal.sessions.ObjectChangeSet owner,
                                       org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Build and return a change set for the specified element.


buildElementFromChangeSet

protected java.lang.Object buildElementFromChangeSet(java.lang.Object changeSet,
                                                     org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
Build and return a new element based on the change set.


buildElementFromElement

public java.lang.Object buildElementFromElement(java.lang.Object element,
                                                org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
INTERNAL: Build and return a new element based on the specified element.


buildRemovedElementFromChangeSet

public java.lang.Object buildRemovedElementFromChangeSet(java.lang.Object changeSet,
                                                         org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
INTERNAL: Build and return a new element based on the change set.


clone

public java.lang.Object clone()
INTERNAL: Clone the appropriate attributes.

Overrides:
clone in class CollectionMapping

collectFields

protected java.util.Vector collectFields()
Return all the fields mapped by the mapping.

Overrides:
collectFields in class DatabaseMapping

compareElements

public boolean compareElements(java.lang.Object element1,
                               java.lang.Object element2,
                               org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Compare the non-null elements and return true if they are alike.


mapKeyHasChanged

public boolean mapKeyHasChanged(java.lang.Object element,
                                org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Return whether the element's user-defined Map key has changed since it was cloned from the original version. Object elements can change their keys without detection. Get the original object and compare keys.


compareElementsForChange

public boolean compareElementsForChange(java.lang.Object element1,
                                        java.lang.Object element2,
                                        org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Compare the non-null elements and return true if they are alike. Here we use object identity.


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: Compare the changes between two collections. Element comparisons are made using identity and, when appropriate, the value of the element's key for the Map container.

Overrides:
compareForChange in class CollectionMapping
Returns:
prototype.changeset.ChangeRecord

compareObjects

public boolean compareObjects(java.lang.Object object1,
                              java.lang.Object object2,
                              org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Compare the attributes belonging to this mapping for the objects.

Overrides:
compareObjects in class CollectionMapping

simpleAddToCollectionChangeRecord

public void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey,
                                              java.lang.Object changeSetToAdd,
                                              org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet,
                                              org.eclipse.persistence.internal.sessions.AbstractSession session)
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.

Overrides:
simpleAddToCollectionChangeRecord in class CollectionMapping

simpleRemoveFromCollectionChangeRecord

public void simpleRemoveFromCollectionChangeRecord(java.lang.Object referenceKey,
                                                   java.lang.Object changeSetToRemove,
                                                   org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet,
                                                   org.eclipse.persistence.internal.sessions.AbstractSession session)
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.

Overrides:
simpleRemoveFromCollectionChangeRecord in class CollectionMapping

deleteAll

protected void deleteAll(DeleteObjectQuery query,
                         java.lang.Object referenceObjects)
                  throws DatabaseException
Delete all the reference objects.

Throws:
DatabaseException

deleteAll

protected void deleteAll(DeleteObjectQuery query)
                  throws DatabaseException
Delete all the reference objects.

Throws:
DatabaseException

deleteReferenceObjectsLeftOnDatabase

protected void deleteReferenceObjectsLeftOnDatabase(DeleteObjectQuery query)
                                             throws DatabaseException,
                                                    OptimisticLockException
This method will make sure that all the records privately owned by this mapping are actually removed. If such records are found then those are all read and removed one by one along with their privately owned parts.

Throws:
DatabaseException
OptimisticLockException

extractKeyRowFromReferenceObject

protected XMLRecord extractKeyRowFromReferenceObject(java.lang.Object object,
                                                     org.eclipse.persistence.internal.sessions.AbstractSession session,
                                                     XMLRecord parentRecord)
Build and return a database row that contains a foreign key for the specified reference object. This will be stored in the nested row(s).


valueFromRow

public java.lang.Object valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                     org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
                                     ObjectBuildingQuery sourceQuery,
                                     org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
                              throws DatabaseException
INTERNAL: Return the value of the reference attribute or a value holder. Check whether the mapping's attribute should be optimized through batch and joining.

Overrides:
valueFromRow in class ForeignReferenceMapping
Throws:
DatabaseException

getForeignKeyRows

public java.util.Vector getForeignKeyRows(org.eclipse.persistence.internal.sessions.AbstractRecord row)
INTERNAL:


writeFromObjectIntoRow

public void writeFromObjectIntoRow(java.lang.Object object,
                                   org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                   org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Get the appropriate attribute value from the object and put it in the appropriate field of the database row. Loop through the reference objects and extract the primary keys and put them in the vector of "nested" rows.

Overrides:
writeFromObjectIntoRow in class DatabaseMapping

writeFromObjectIntoRowForShallowInsert

public void writeFromObjectIntoRowForShallowInsert(java.lang.Object object,
                                                   org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                                   org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts. The foreign keys must be set to null to avoid constraints.

Overrides:
writeFromObjectIntoRowForShallowInsert in class DatabaseMapping

writeFromObjectIntoRowForShallowInsertWithChangeRecord

public void writeFromObjectIntoRowForShallowInsertWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
                                                                   org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                                                   org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: This row is built for shallow insert which happens in case of bidirectional inserts. The foreign keys must be set to null to avoid constraints.

Overrides:
writeFromObjectIntoRowForShallowInsertWithChangeRecord in class DatabaseMapping

writeFromObjectIntoRowForUpdate

public void writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery,
                                            org.eclipse.persistence.internal.sessions.AbstractRecord row)
                                     throws DescriptorException
INTERNAL: If any of the references objects has changed, write out all the keys.

Overrides:
writeFromObjectIntoRowForUpdate in class DatabaseMapping
Throws:
DescriptorException

writeFromObjectIntoRowWithChangeRecord

public void writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
                                                   org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                                   org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Get the appropriate attribute value from the object and put it in the appropriate field of the database row. Loop through the reference objects and extract the primary keys and put them in the vector of "nested" rows.

Overrides:
writeFromObjectIntoRowWithChangeRecord in class DatabaseMapping

writeInsertFieldsIntoRow

public void writeInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                     org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Write fields needed for insert into the template for with null values.

Overrides:
writeInsertFieldsIntoRow in class DatabaseMapping

executeBatchQueryForPessimisticLocking

protected java.lang.Object executeBatchQueryForPessimisticLocking(DatabaseQuery query,
                                                                  org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
                                                                  org.eclipse.persistence.internal.sessions.AbstractRecord argumentRow)
INTERNAL: This method is not supported in an EIS environment.


setSelectionSQLString

public void setSelectionSQLString(java.lang.String sqlString)
INTERNAL: This method is not supported in an EIS environment.

Overrides:
setSelectionSQLString in class ForeignReferenceMapping

setSelectionCriteria

public void setSelectionCriteria(Expression anExpression)
INTERNAL: This method is not supported in an EIS environment.

Overrides:
setSelectionCriteria in class ForeignReferenceMapping

setUsesBatchReading

public void setUsesBatchReading(boolean usesBatchReading)
INTERNAL: This method is not supported in an EIS environment.

Overrides:
setUsesBatchReading in class ForeignReferenceMapping

shouldUseBatchReading

public boolean shouldUseBatchReading()
INTERNAL: This method is not supported in an EIS environment.

Overrides:
shouldUseBatchReading in class ForeignReferenceMapping

useBatchReading

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

Overrides:
useBatchReading in class ForeignReferenceMapping

dontUseBatchReading

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

Overrides:
dontUseBatchReading in class ForeignReferenceMapping

addAscendingOrdering

public void addAscendingOrdering(java.lang.String queryKeyName)
INTERNAL: This method is not supported in an EIS environment.

Overrides:
addAscendingOrdering in class CollectionMapping

addDescendingOrdering

public void addDescendingOrdering(java.lang.String queryKeyName)
INTERNAL: This method is not supported in an EIS environment.

Overrides:
addDescendingOrdering in class CollectionMapping

setDeleteAllSQLString

public void setDeleteAllSQLString(java.lang.String sqlString)
INTERNAL: This method is not supported in an EIS environment.

Overrides:
setDeleteAllSQLString in class CollectionMapping

EclipseLink 2.0.0, build 'v20091127-r5931' API Reference