Class EISOneToManyMapping
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.eis.mappings.EISOneToManyMapping
- All Implemented Interfaces:
Serializable
,Cloneable
,EISMapping
,ContainerMapping
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. |
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.persistence.mappings.DatabaseMapping
DatabaseMapping.WriteType
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.eclipse.persistence.internal.helper.DatabaseField
The grouping-element field.protected boolean
Keeps track if any of the fields are foreign keys.protected List<org.eclipse.persistence.internal.helper.DatabaseField>
The (typically primary) source key fields that are referenced by the targetForeignKeyFields.protected Map<org.eclipse.persistence.internal.helper.DatabaseField,
org.eclipse.persistence.internal.helper.DatabaseField> This maps the source foreign key fields to the corresponding (primary) target key fields.protected List<org.eclipse.persistence.internal.helper.DatabaseField>
The target foreign key fields that reference the sourceKeyFields.Fields inherited from class org.eclipse.persistence.mappings.CollectionMapping
changeOrderTargetQuery, containerPolicy, deleteAllQuery, hasCustomDeleteAllQuery, hasOrderBy, isListOrderFieldSupported, isSynchronizeOnMerge, listOrderField, mustDeleteReferenceObjectsOneByOne, orderCorrectionType
Fields inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
batchFetchType, cascadeDetach, cascadeMerge, cascadePersist, cascadeRefresh, cascadeRemove, forceInitializationOfSelectionCriteria, hasCustomSelectionQuery, indirectionPolicy, INNER_JOIN, isCascadeOnDeleteSetOnDatabase, isPrivateOwned, joinFetch, mappedBy, NONE, OUTER_JOIN, partitioningPolicy, partitioningPolicyName, QUERY_BATCH_PARAMETER, referenceClass, referenceClassName, referenceDescriptor, relationshipPartner, relationshipPartnerAttributeName, requiresTransientWeavedFields, selectionQuery, tempInitSession
Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping
attributeAccessor, attributeName, derivedIdMapping, derivesId, descriptor, fields, isCacheable, isInSopObject, isJPAId, isLazy, isMapKeyMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, mapsIdValue, NO_FIELDS, NO_WEIGHT, properties, unconvertedProperties, weight, WEIGHT_AGGREGATE, WEIGHT_DIRECT, WEIGHT_TO_ONE, WEIGHT_TRANSFORM
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
(String sourceForeignKeyFieldName, String targetKeyFieldName) PUBLIC: Define the source foreign key relationship in the one-to-many mapping.buildAddedElementFromChangeSet
(Object changeSet, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession) INTERNAL: Build and return a new element based on the change set.buildChangeSet
(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 Object
buildElementFromChangeSet
(Object changeSet, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession) Build and return a new element based on the change set.buildElementFromElement
(Object element, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession) INTERNAL: Build and return a new element based on the specified element.buildExpression
(Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, Map processedObjects, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: In case Query By Example is used, this method builds and returns an expression that corresponds to a single attribute and it's value.buildRemovedElementFromChangeSet
(Object changeSet, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession) INTERNAL: Build and return a new element based on the change set.clone()
INTERNAL: Clone the appropriate attributes.protected Vector
Return all the fields mapped by the mapping.boolean
compareElements
(Object element1, Object element2, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Compare the non-null elements and return true if they are alike.boolean
compareElementsForChange
(Object element1, 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
(Object clone, 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
(Object object1, 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, Object referenceObjects) Delete all the reference objects.protected void
This method will make sure that all the records privately owned by this mapping are actually removed.protected org.eclipse.persistence.internal.sessions.AbstractRecord
extractKeyRowFromReferenceObject
(Object object, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord parentRecord) Build and return a database row that contains a foreign key for the specified reference object.org.eclipse.persistence.internal.helper.DatabaseField
Get the grouping element field on the mapping.getForeignKeyRows
(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL:List<org.eclipse.persistence.internal.helper.DatabaseField>
INTERNAL: Return the source foreign key fields.Map<org.eclipse.persistence.internal.helper.DatabaseField,
org.eclipse.persistence.internal.helper.DatabaseField> INTERNAL: Sets the target foreign key fields.List<org.eclipse.persistence.internal.helper.DatabaseField>
INTERNAL: Return the source foreign key fields.boolean
boolean
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
Initialize the delete all query.protected void
initializeSelectionCriteria
(org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Selection criteria is created with source foreign keys and target keys.protected void
boolean
INTERNAL:boolean
INTERNAL: Return if the 1-M mapping has a foreign key dependency to its target.boolean
mapKeyHasChanged
(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.void
mergeChangesIntoObject
(Object target, org.eclipse.persistence.internal.sessions.ChangeRecord chgRecord, Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession) INTERNAL: If the mapping has a foreign key, it is order, so must use a different merge.void
mergeIntoObject
(Object target, boolean isTargetUnInitialized, Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession) INTERNAL: If the mapping has a foreign key, it is order, so must use a different merge.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
preInitialize
(org.eclipse.persistence.internal.sessions.AbstractSession session) Fix field names for XML data descriptors.void
preInsert
(WriteObjectQuery query) INTERNAL: Insert privately owned partsvoid
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
(String sqlString) INTERNAL: This method is not supported in an EIS environment.void
Set the grouping element field on the mapping.void
setForeignKeyGroupingElement
(org.eclipse.persistence.internal.helper.DatabaseField 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
setSelectionSQLString
(String sqlString) INTERNAL: This method is not supported in an EIS environment.void
setSourceForeignKeyFields
(List<org.eclipse.persistence.internal.helper.DatabaseField> fields) INTERNAL: Sets the source foreign key fields.void
setSourceForeignKeysToTargetKeys
(Map<org.eclipse.persistence.internal.helper.DatabaseField, org.eclipse.persistence.internal.helper.DatabaseField> sourceToTargetKeyFields) INTERNAL: Set the source keys to target keys fields association.void
setTargetForeignKeyFields
(List<org.eclipse.persistence.internal.helper.DatabaseField> fields) INTERNAL: Sets the target foreign key fields.protected boolean
Return whether any process leading to object modification should also affect its parts.void
simpleAddToCollectionChangeRecord
(Object referenceKey, 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
(Object referenceKey, 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.valueFromRow
(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, org.eclipse.persistence.internal.sessions.AbstractSession executionSession, boolean isTargetProtected, Boolean[] wasCacheUsed) INTERNAL: Return the value of the reference attribute or a value holder.boolean
verifyDelete
(Object object, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Used to verify whether the specified object is deleted or not.void
writeFromObjectIntoRow
(Object object, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType) INTERNAL: Get the appropriate attribute value from the object and put it in the appropriate field of the database row.void
writeFromObjectIntoRowForShallowInsert
(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
writeFromObjectIntoRowForUpdateAfterShallowInsert
(Object object, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.helper.DatabaseTable table) INTERNAL: This row is built for update after shallow insert which happens in case of bidirectional inserts.void
writeFromObjectIntoRowWithChangeRecord
(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType) 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, addAscendingOrdering, addDescendingOrdering, addOrderBy, buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildContainerClone, buildCopy, buildElementClone, buildElementUnitOfWorkClone, buildListOrderField, buildReferencesPKList, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cascadeRegisterNewIfRequired, collectQueryParameters, compareCollectionsForChange, compareLists, compareListsAndWrite, compareObjectsAndWrite, compareObjectsWithoutPrivateOwned, compareObjectsWithPrivateOwned, convertClassNamesToClasses, copyElement, executeBatchQuery, extractKeyFromTargetRow, extractResultFromBatchQuery, fixRealObjectReferences, getAdditionalFieldsBaseExpression, getContainerPolicy, getJoinCriteria, getListOrderField, getObjectCorrespondingTo, getOrderByQueryKeyExpressions, getOrderCorrectionType, getRealCollectionAttributeValueFromObject, getSelectionQueryContainerPolicy, getTargetPrimaryKeyFields, hasOrderBy, initializeChangeOrderTargetQuery, initializeListOrderField, initializeListOrderFieldTable, isAttributeValueInstantiatedOrChanged, isChangeTrackingSupported, isCollectionMapping, isListOrderFieldSupported, isMapKeyObjectRelationship, iterateOnElement, iterateOnRealAttributeValue, load, loadAll, mustDeleteReferenceObjectsOneByOne, objectAddedDuringUpdate, objectOrderChangedDuringUpdate, objectRemovedDuringUpdate, objectUnchangedDuringUpdate, objectUnchangedDuringUpdate, postCalculateChanges, postInitialize, postPrepareNestedBatchQuery, prepareTranslationRow, readPrivateOwnedForObject, recordPrivateOwnedRemovals, replaceValueHoldersIn, setChangeListener, setContainerPolicy, setCustomDeleteAllQuery, setDeleteAllQuery, setHasCustomDeleteAllQuery, setListOrderField, setListOrderFieldName, setMustDeleteReferenceObjectsOneByOne, setOrderCorrectionType, setSelectionQueryContainerPolicy, setSessionName, setUseLazyInstantiationForIndirectCollection, shouldUseLazyInstantiationForIndirectCollection, shouldUseListOrderFieldTableExpression, updateChangeRecord, updateChangeRecordForSelfMerge, updateCollectionChangeRecord, useCollectionClass, useCollectionClassName, useListClassName, useMapClass, useMapClass, useMapClassName, useSortedSetClass, useSortedSetClassName, useSortedSetClassName, useTransparentCollection, useTransparentList, useTransparentMap, useTransparentSet, validateBeforeInitialization, valueFromPKList, valueFromRowInternalWithJoin, writeChanges
Methods inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
addTargetForeignKeyField, batchedValueFromRow, buildBackupClone, buildBatchCriteria, buildClone, buildCloneFromRow, checkCacheForBatchKey, createCloneValueHolder, dontDoMerge, dontUseBatchReading, dontUseIndirection, extendPessimisticLockScopeInSourceQuery, extendPessimisticLockScopeInTargetQuery, extractBatchKeyFromRow, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getBatchFetchType, getExtendPessimisticLockScopeDedicatedQuery, getFieldsForTranslationInAggregate, getIndirectionPolicy, getJoinFetch, getMappedBy, getOrderByNormalizedExpressions, getPartitioningPolicy, getPartitioningPolicyName, getRealAttributeValueFromAttribute, getReferenceClass, getReferenceClassName, getReferenceDescriptor, getRelationshipPartner, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getTempSession, getValueFromRemoteValueHolder, hasCustomSelectionQuery, hasDependency, hasNestedIdentityReference, initializeReferenceDescriptor, initializeSelectionQuery, instantiateAttribute, isAttributeValueFromObjectInstantiated, isAttributeValueFullyBuilt, isAttributeValueInstantiated, isCascadeDetach, isCascadeMerge, isCascadeOnDeleteSetOnDatabase, isCascadePersist, isCascadeRefresh, isCascadeRemove, isExtendingPessimisticLockScope, isForeignReferenceMapping, isInnerJoinFetched, isJoinFetched, isJoiningSupported, isLazy, isLockableMapping, isOuterJoinFetched, isPrivateOwned, iterate, mergeRemoteValueHolder, prepareHistoricalQuery, prepareNestedBatchQuery, prepareNestedJoinQueryClone, prepareNestedJoins, privateOwnedRelationship, readFromRowIntoObject, remoteInitialization, requiresTransientWeavedFields, setBatchFetchType, setCascadeAll, setCascadeDetach, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setForceInitializationOfSelectionCriteria, setHasCustomSelectionQuery, setIndirectionPolicy, setIsCacheable, setIsCascadeOnDeleteSetOnDatabase, setIsPrivateOwned, setJoinFetch, setMappedBy, setPartitioningPolicy, setPartitioningPolicyName, setRealAttributeValueInObject, setReferenceClass, setReferenceClassName, setReferenceDescriptor, setRelationshipPartner, setRelationshipPartnerAttributeName, setRequiresTransientWeavedFields, setSelectionCall, setSelectionCriteria, setSelectionQuery, setShouldExtendPessimisticLockScope, setTempSession, setUsesBatchReading, setUsesIndirection, shouldExtendPessimisticLockScope, shouldExtendPessimisticLockScopeInDedicatedQuery, shouldExtendPessimisticLockScopeInSourceQuery, shouldExtendPessimisticLockScopeInTargetQuery, shouldForceInitializationOfSelectionCriteria, shouldInitializeSelectionCriteria, shouldMergeCascadeParts, shouldMergeCascadeReference, shouldRefreshCascadeParts, shouldUseBatchReading, shouldUseValueFromRowWithJoin, trimRowForJoin, trimRowForJoin, useBasicIndirection, useBatchReading, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection, valueFromRowInternal, valueFromRowInternal
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
addUnconvertedProperty, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, cloneFields, convertConverterClassNamesToClasses, derivesId, earlyPreDelete, extractNestedExpressions, extractNestedNonAggregateExpressions, getAttributeAccessor, getAttributeClassification, getAttributeName, getDerivedIdMapping, getDescriptor, getField, getFieldClassification, getFields, getGetMethodName, getMapsIdValue, getProperties, getProperty, getRealAttributeValueFromObject, getSelectFields, getSelectTables, getSetMethodName, getUnconvertedProperties, getWeight, hasConstraintDependency, hasMapsIdValue, hasRootExpressionThatShouldUseOuterJoin, hasUnconvertedProperties, isAbstractColumnMapping, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCacheable, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isCloningRequired, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isElementCollectionMapping, isInAndOutSopObject, isInOnlySopObject, isInSopObject, isJPAId, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isMultitenantPrimaryKeyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOutOnlySopObject, isOutSopObject, isOwned, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isRelationalMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, performDataModificationEvent, postCalculateChangesOnDeleted, postInitializeSourceAndTargetExpressions, prepareCascadeLockingPolicy, readFromResultSetIntoObject, readOnly, readWrite, rehashFieldDependancies, remotelyInitialized, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setDerivedIdMapping, setDerivesId, setDescriptor, setFields, setGetMethodName, setIsInAndOutSopObject, setIsInSopObject, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsOutSopObject, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setSetMethodName, setWeight, toString, validateAfterInitialization, valueFromObject, valueFromResultSet, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRowForUpdateBeforeShallowDelete, writeFromObjectIntoRowForWhereClause, writeUpdateFieldsIntoRow
-
Field Details
-
isForeignKeyRelationship
protected boolean isForeignKeyRelationshipKeeps track if any of the fields are foreign keys. -
targetForeignKeyFields
protected transient List<org.eclipse.persistence.internal.helper.DatabaseField> targetForeignKeyFieldsThe target foreign key fields that reference the sourceKeyFields. -
sourceForeignKeyFields
protected transient List<org.eclipse.persistence.internal.helper.DatabaseField> sourceForeignKeyFieldsThe (typically primary) source key fields that are referenced by the targetForeignKeyFields. -
sourceForeignKeysToTargetKeys
protected transient Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> sourceForeignKeysToTargetKeysThis maps the source foreign key fields to the corresponding (primary) target key fields. -
foreignKeyGroupingElement
protected org.eclipse.persistence.internal.helper.DatabaseField foreignKeyGroupingElementThe grouping-element field.
-
-
Constructor Details
-
EISOneToManyMapping
public EISOneToManyMapping()
-
-
Method Details
-
isEISMapping
public boolean isEISMapping()INTERNAL:- Overrides:
isEISMapping
in classDatabaseMapping
-
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.- Overrides:
addForeignKeyField
in classForeignReferenceMapping
-
addForeignKeyFieldName
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 org.eclipse.persistence.internal.helper.DatabaseField getForeignKeyGroupingElement()Get the grouping element field on the mapping. This is an optional setting. -
setForeignKeyGroupingElement
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 classCollectionMapping
-
getDeleteAllQuery
- Overrides:
getDeleteAllQuery
in classCollectionMapping
-
setDeleteAllCall
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 classCollectionMapping
-
setForeignKeyGroupingElement
public void setForeignKeyGroupingElement(org.eclipse.persistence.internal.helper.DatabaseField 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
INTERNAL: Return the source foreign key fields. -
setSourceForeignKeyFields
public void setSourceForeignKeyFields(List<org.eclipse.persistence.internal.helper.DatabaseField> fields) INTERNAL: Sets the source foreign key fields. -
getTargetForeignKeyFields
INTERNAL: Return the source foreign key fields. -
setTargetForeignKeyFields
public void setTargetForeignKeyFields(List<org.eclipse.persistence.internal.helper.DatabaseField> fields) INTERNAL: Sets the target foreign key fields. -
getSourceForeignKeysToTargetKeys
public Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> getSourceForeignKeysToTargetKeys()INTERNAL: Sets the target foreign key fields. -
setSourceForeignKeysToTargetKeys
public void setSourceForeignKeysToTargetKeys(Map<org.eclipse.persistence.internal.helper.DatabaseField, org.eclipse.persistence.internal.helper.DatabaseField> 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 classDatabaseMapping
-
initialize
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException INTERNAL: Initialize the mapping.- Overrides:
initialize
in classCollectionMapping
- Throws:
DescriptorException
-
initializeSelectionCriteria
protected void initializeSelectionCriteria(org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Selection criteria is created with source foreign keys and target keys. This criteria is then used to read target records from the table. CR#3922 - This method is almost the same as buildSelectionCriteria() the difference is that getSelectionCriteria() is called -
initializeSourceForeignKeysToTargetKeys
- Throws:
DescriptorException
-
initializeDeleteAllQuery
protected void initializeDeleteAllQuery()Initialize the delete all query. This query is used to delete the collection of objects from the database. -
preInitialize
public void preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session) Fix field names for XML data descriptors. Since fields are fixed to use text() by default in descriptor, ensure the correct non text field is used here.- Overrides:
preInitialize
in classForeignReferenceMapping
-
shouldObjectModifyCascadeToParts
Return whether any process leading to object modification should also affect its parts. Used by write, insert, update, and delete.- Overrides:
shouldObjectModifyCascadeToParts
in classForeignReferenceMapping
-
verifyDelete
public boolean verifyDelete(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 classCollectionMapping
- Throws:
DatabaseException
-
postInsert
INTERNAL: Insert the reference objects.- Overrides:
postInsert
in classCollectionMapping
- Throws:
DatabaseException
OptimisticLockException
-
postUpdate
INTERNAL: Update the reference objects.- Overrides:
postUpdate
in classDatabaseMapping
- Throws:
DatabaseException
OptimisticLockException
-
postDelete
INTERNAL: Delete the reference objects.- Overrides:
postDelete
in classCollectionMapping
- Throws:
DatabaseException
OptimisticLockException
-
preDelete
INTERNAL: Delete the reference objects.- Overrides:
preDelete
in classDatabaseMapping
- Throws:
DatabaseException
OptimisticLockException
-
preInsert
INTERNAL: Insert privately owned parts- Overrides:
preInsert
in classCollectionMapping
- Throws:
DatabaseException
OptimisticLockException
-
preUpdate
INTERNAL: Update the privately owned parts.- Overrides:
preUpdate
in classCollectionMapping
- Throws:
DatabaseException
OptimisticLockException
-
buildAddedElementFromChangeSet
public Object buildAddedElementFromChangeSet(Object changeSet, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession) INTERNAL: Build and return a new element based on the change set. -
buildChangeSet
public Object buildChangeSet(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 Object buildElementFromChangeSet(Object changeSet, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession) Build and return a new element based on the change set. -
buildElementFromElement
public Object buildElementFromElement(Object element, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession) INTERNAL: Build and return a new element based on the specified element. -
buildExpression
public Expression buildExpression(Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, Map processedObjects, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: In case Query By Example is used, this method builds and returns an expression that corresponds to a single attribute and it's value.- Overrides:
buildExpression
in classCollectionMapping
-
buildRemovedElementFromChangeSet
public Object buildRemovedElementFromChangeSet(Object changeSet, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession) INTERNAL: Build and return a new element based on the change set. -
clone
INTERNAL: Clone the appropriate attributes.- Overrides:
clone
in classCollectionMapping
-
collectFields
Return all the fields mapped by the mapping.- Overrides:
collectFields
in classDatabaseMapping
-
compareElements
public boolean compareElements(Object element1, 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(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(Object element1, 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(Object clone, 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 classCollectionMapping
- Returns:
- prototype.changeset.ChangeRecord
-
compareObjects
public boolean compareObjects(Object object1, Object object2, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Compare the attributes belonging to this mapping for the objects.- Overrides:
compareObjects
in classCollectionMapping
-
mergeChangesIntoObject
public void mergeChangesIntoObject(Object target, org.eclipse.persistence.internal.sessions.ChangeRecord chgRecord, Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession) INTERNAL: If the mapping has a foreign key, it is order, so must use a different merge.- Overrides:
mergeChangesIntoObject
in classCollectionMapping
-
mergeIntoObject
public void mergeIntoObject(Object target, boolean isTargetUnInitialized, Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession) INTERNAL: If the mapping has a foreign key, it is order, so must use a different merge.- Overrides:
mergeIntoObject
in classCollectionMapping
-
simpleAddToCollectionChangeRecord
public void simpleAddToCollectionChangeRecord(Object referenceKey, 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 classCollectionMapping
-
simpleRemoveFromCollectionChangeRecord
public void simpleRemoveFromCollectionChangeRecord(Object referenceKey, 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 classCollectionMapping
-
deleteAll
Delete all the reference objects.- Throws:
DatabaseException
-
deleteAll
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. -
extractKeyRowFromReferenceObject
protected org.eclipse.persistence.internal.sessions.AbstractRecord extractKeyRowFromReferenceObject(Object object, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord 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 Object valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, org.eclipse.persistence.internal.sessions.AbstractSession executionSession, boolean isTargetProtected, Boolean[] wasCacheUsed) 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 classForeignReferenceMapping
- Throws:
DatabaseException
-
getForeignKeyRows
public Vector getForeignKeyRows(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: -
writeFromObjectIntoRow
public void writeFromObjectIntoRow(Object object, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType) 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 classDatabaseMapping
-
writeFromObjectIntoRowForShallowInsert
public void writeFromObjectIntoRowForShallowInsert(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 classDatabaseMapping
-
writeFromObjectIntoRowForUpdateAfterShallowInsert
public void writeFromObjectIntoRowForUpdateAfterShallowInsert(Object object, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.helper.DatabaseTable table) INTERNAL: This row is built for update after shallow insert which happens in case of bidirectional inserts. It contains the foreign keys with non null values that were set to null for shallow insert. If mapping overrides writeFromObjectIntoRowForShallowInsert method it must override this one, too.- Overrides:
writeFromObjectIntoRowForUpdateAfterShallowInsert
in classDatabaseMapping
-
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 classDatabaseMapping
-
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 classDatabaseMapping
- 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, DatabaseMapping.WriteType writeType) 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 classDatabaseMapping
-
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 classDatabaseMapping
-
setSelectionSQLString
INTERNAL: This method is not supported in an EIS environment.- Overrides:
setSelectionSQLString
in classForeignReferenceMapping
-
setDeleteAllSQLString
INTERNAL: This method is not supported in an EIS environment.- Overrides:
setDeleteAllSQLString
in classCollectionMapping
-