public class OneToManyMapping extends CollectionMapping implements RelationalMapping, MapComponentMapping
Purpose: This mapping is used to represent the typical RDBMS relationship between a single source object and collection of target objects; where, on the database, the target objects have references (foreign keys) to the source object.
DatabaseMapping.WriteType
Modifier and Type | Field and Description |
---|---|
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 |
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 |
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 java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> |
sourceKeyFields
The (typically primary) source key fields that are referenced by the targetForeignKeyFields.
|
protected java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> |
sourceKeysToTargetForeignKeys
This maps the (primary) source key fields to the corresponding target foreign key fields.
|
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> |
targetForeignKeyFields
The target foreign key fields that reference the sourceKeyFields.
|
protected java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> |
targetForeignKeysToSourceKeys
This maps the target foreign key fields to the corresponding (primary) source key fields.
|
protected org.eclipse.persistence.internal.helper.DatabaseTable |
targetForeignKeyTable
All targetForeignKeyFields should have the same table.
|
protected java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> |
targetPrimaryKeyFields
Primary keys of targetForeignKeyTable:
the same as referenceDescriptor().getPrimaryKeyFields() in case the table is default table of reference descriptor;
otherwise contains secondary table's primary key fields in the same order as default table primary keys mapped to them.
|
changeOrderTargetQuery, containerPolicy, deleteAllQuery, hasCustomDeleteAllQuery, hasOrderBy, isListOrderFieldSupported, isSynchronizeOnMerge, listOrderField, mustDeleteReferenceObjectsOneByOne, orderCorrectionType
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
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 and Description |
---|
OneToManyMapping()
PUBLIC:
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addTargetForeignKeyField(org.eclipse.persistence.internal.helper.DatabaseField targetForeignKeyField,
org.eclipse.persistence.internal.helper.DatabaseField sourceKeyField)
INTERNAL:
Add the associated fields to the appropriate collections.
|
void |
addTargetForeignKeyFieldName(java.lang.String targetForeignKeyFieldName,
java.lang.String sourceKeyFieldName)
PUBLIC:
Define the target foreign key relationship in the one-to-many mapping.
|
protected Expression |
buildBatchCriteria(ExpressionBuilder builder,
ObjectLevelReadQuery query)
INTERNAL:
Return the selection criteria used to IN batch fetching.
|
protected Expression |
buildDefaultSelectionCriteriaAndAddFieldsToQuery()
The selection criteria are created with target foreign keys and source "primary" keys.
|
protected org.eclipse.persistence.internal.sessions.AbstractRecord |
buildKeyRowForTargetUpdate(ObjectLevelModifyQuery query) |
protected void |
buildListOrderField()
INTERNAL:
Verifies listOrderField's table: it must be the same table that contains all target foreign keys.
|
Expression |
buildSelectionCriteria()
This method would allow customers to get the potential selection criteria for a mapping
prior to initialization.
|
java.lang.Object |
clone()
INTERNAL:
Clone the appropriate attributes.
|
void |
collectQueryParameters(java.util.Set<org.eclipse.persistence.internal.helper.DatabaseField> cacheFields)
INTERNAL:
This method is used to store the FK fields that can be cached that correspond to noncacheable mappings
the FK field values will be used to re-issue the query when cloning the shared cache entity
|
java.lang.Object |
createMapComponentFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow,
ObjectBuildingQuery query,
org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey,
org.eclipse.persistence.internal.sessions.AbstractSession session,
boolean isTargetProtected)
INTERNAL
Called when a DatabaseMapping is used to map the key in a collection.
|
protected org.eclipse.persistence.internal.sessions.AbstractRecord |
createModifyRowForAddTargetQuery()
INTERNAL:
|
protected void |
deleteAll(DeleteObjectQuery query,
org.eclipse.persistence.internal.sessions.AbstractSession session)
Delete all the reference objects with a single query.
|
protected void |
deleteReferenceObjectsLeftOnDatabase(DeleteObjectQuery query)
This method will make sure that all the records privately owned by this mapping are
actually removed.
|
protected java.lang.Object |
extractBatchKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session)
Extract the key field values from the specified row.
|
protected java.lang.Object |
extractKeyFromTargetRow(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.
|
protected ModifyQuery |
getDeleteAllQuery()
Overrides CollectionMappig because this mapping requires a DeleteAllQuery instead of a ModifyQuery.
|
java.util.Collection |
getFieldsForTranslationInAggregate()
INTERNAL:
Return source key fields for translation by an AggregateObjectMapping
|
java.util.Vector |
getSourceKeyFieldNames()
PUBLIC:
Return the source key field names associated with the mapping.
|
java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> |
getSourceKeyFields()
INTERNAL:
Return the source key fields.
|
java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> |
getSourceKeysToTargetForeignKeys()
INTERNAL:
Return the source/target key fields.
|
java.util.Vector |
getTargetForeignKeyFieldNames()
INTERNAL:
Return the target foreign key field names associated with the mapping.
|
java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> |
getTargetForeignKeyFields()
INTERNAL:
Return the target foreign key fields.
|
java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> |
getTargetForeignKeysToSourceKeys()
INTERNAL:
Return the target/source key fields.
|
java.util.Map |
getTargetForeignKeyToSourceKeys()
INTERNAL:
Maintain for backward compatibility.
|
java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> |
getTargetPrimaryKeyFields()
INTERNAL:
Primary keys of targetForeignKeyTable.
|
boolean |
hasInverseConstraintDependency()
INTERNAL:
Return whether the mapping has any inverse constraint dependencies,
such as foreign keys and join tables.
|
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 |
initializeChangeOrderTargetQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Initialize changeOrderTargetQuery.
|
protected void |
initializeDeleteAllQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
Initialize the delete all query.
|
protected void |
initializeReferenceDescriptor(org.eclipse.persistence.internal.sessions.AbstractSession session)
Initialize and set the descriptor for the referenced class in this mapping.
|
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.
|
protected void |
initializeTargetForeignKeysToSourceKeys()
Verify, munge, and hash the target foreign keys and source keys.
|
protected void |
initializeTargetPrimaryKeyFields()
INTERNAL:
Initialize targetForeignKeyTable and initializeTargetPrimaryKeyFields.
|
boolean |
isCascadedLockingSupported()
INTERNAL
Return true if this mapping supports cascaded version optimistic locking.
|
boolean |
isJoiningSupported()
INTERNAL:
Return if this mapping support joining.
|
boolean |
isOneToManyMapping()
INTERNAL:
|
boolean |
isRelationalMapping()
INTERNAL:
|
protected boolean |
isSourceKeySpecified()
Return whether the source key is specified.
|
protected void |
objectAddedDuringUpdate(ObjectLevelModifyQuery query,
java.lang.Object objectAdded,
org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet,
java.util.Map extraData)
INTERNAL:
An object was added to the collection during an update, insert it if private.
|
protected void |
objectRemovedDuringUpdate(ObjectLevelModifyQuery query,
java.lang.Object objectDeleted,
java.util.Map extraData)
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 |
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 |
prepareCascadeLockingPolicy()
Prepare a cascade locking policy.
|
boolean |
requiresDataModificationEvents()
INTERNAL:
Returns whether this mapping uses data modification events to complete its writes
|
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 |
setDeleteAllSQLString(java.lang.String sqlString)
PUBLIC:
Set the SQL string used by the mapping to delete the target objects.
|
void |
setSessionName(java.lang.String name)
PUBLIC:
Set the name of the session to execute the mapping's queries under.
|
void |
setSourceKeyFieldNames(java.util.Vector fieldNames)
INTERNAL:
Set the source key field names associated with the mapping.
|
void |
setSourceKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceKeyFields)
INTERNAL:
Set the source key fields.
|
void |
setTargetForeignKeyFieldName(java.lang.String targetForeignKeyFieldName)
PUBLIC:
Define the target foreign key relationship in the one-to-many mapping.
|
void |
setTargetForeignKeyFieldNames(java.lang.String[] targetForeignKeyFieldNames,
java.lang.String[] sourceKeyFieldNames)
PUBLIC:
Define the target foreign key relationship in the one-to-many mapping.
|
void |
setTargetForeignKeyFieldNames(java.util.Vector fieldNames)
INTERNAL:
Set the target key field names associated with the mapping.
|
void |
setTargetForeignKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> targetForeignKeyFields)
INTERNAL:
Set the target fields.
|
protected void |
setTargetForeignKeysToSourceKeys(java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> targetForeignKeysToSourceKeys)
INTERNAL:
Set the target fields.
|
protected boolean |
shouldObjectModifyCascadeToParts(ObjectLevelModifyQuery query)
Return whether any process leading to object modification
should also affect its parts.
|
protected boolean |
shouldRemoveTargetQueryModifyTargetForeignKey()
INTERNAL
If it's not a map then target foreign key has been already modified (set to null).
|
void |
updateTargetForeignKeyPostUpdateSource_ObjectAdded(ObjectLevelModifyQuery query,
java.lang.Object objectAdded,
java.util.Map extraData)
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 |
updateTargetRowPostInsertSource(WriteObjectQuery query)
INTERNAL:
Update target foreign keys after a new source was inserted.
|
void |
updateTargetRowPreDeleteSource(ObjectLevelModifyQuery query)
INTERNAL:
Update target foreign key after a target object was removed from the source.
|
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.
|
addAggregateOrderBy, addAscendingOrdering, addDescendingOrdering, addOrderBy, buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildContainerClone, buildCopy, buildElementClone, buildElementUnitOfWorkClone, buildReferencesPKList, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cascadeRegisterNewIfRequired, compareCollectionsForChange, compareForChange, compareLists, compareListsAndWrite, compareObjects, compareObjectsAndWrite, compareObjectsWithoutPrivateOwned, compareObjectsWithPrivateOwned, convertClassNamesToClasses, copyElement, executeBatchQuery, extractResultFromBatchQuery, fixRealObjectReferences, getAdditionalFieldsBaseExpression, getContainerPolicy, getJoinCriteria, getListOrderField, getObjectCorrespondingTo, getOrderByQueryKeyExpressions, getOrderCorrectionType, getRealCollectionAttributeValueFromObject, getSelectionQueryContainerPolicy, hasCustomDeleteAllQuery, hasOrderBy, initializeListOrderField, initializeListOrderFieldTable, isAttributeValueInstantiatedOrChanged, isChangeTrackingSupported, isCollectionMapping, isListOrderFieldSupported, isMapKeyObjectRelationship, iterateOnElement, iterateOnRealAttributeValue, load, loadAll, mergeChangesIntoObject, mergeIntoObject, mustDeleteReferenceObjectsOneByOne, objectOrderChangedDuringUpdate, objectUnchangedDuringUpdate, objectUnchangedDuringUpdate, postCalculateChanges, postDelete, postInitialize, postPrepareNestedBatchQuery, preInsert, prepareTranslationRow, preUpdate, readPrivateOwnedForObject, recordPrivateOwnedRemovals, replaceValueHoldersIn, setChangeListener, setContainerPolicy, setCustomDeleteAllQuery, setDeleteAllCall, setDeleteAllQuery, setHasCustomDeleteAllQuery, setListOrderField, setListOrderFieldName, setMustDeleteReferenceObjectsOneByOne, setOrderCorrectionType, setSelectionQueryContainerPolicy, setUseLazyInstantiationForIndirectCollection, shouldUseLazyInstantiationForIndirectCollection, shouldUseListOrderFieldTableExpression, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, updateChangeRecord, updateChangeRecordForSelfMerge, updateCollectionChangeRecord, useCollectionClass, useCollectionClassName, useListClassName, useMapClass, useMapClass, useMapClassName, useSortedSetClass, useSortedSetClassName, useSortedSetClassName, useTransparentCollection, useTransparentList, useTransparentMap, useTransparentSet, validateBeforeInitialization, valueFromPKList, valueFromRowInternalWithJoin, writeChanges
addForeignKeyField, batchedValueFromRow, buildBackupClone, buildClone, buildCloneFromRow, checkCacheForBatchKey, createCloneValueHolder, dontDoMerge, dontUseBatchReading, dontUseIndirection, extendPessimisticLockScopeInSourceQuery, extendPessimisticLockScopeInTargetQuery, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getBatchFetchType, getExtendPessimisticLockScopeDedicatedQuery, getIndirectionPolicy, getJoinFetch, getMappedBy, getOrderByNormalizedExpressions, getPartitioningPolicy, getPartitioningPolicyName, getRealAttributeValueFromAttribute, getReferenceClass, getReferenceClassName, getReferenceDescriptor, getRelationshipPartner, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getTempSession, getValueFromRemoteValueHolder, hasCustomSelectionQuery, hasDependency, hasNestedIdentityReference, initializeSelectionQuery, instantiateAttribute, isAttributeValueFromObjectInstantiated, isAttributeValueFullyBuilt, isAttributeValueInstantiated, isCascadeDetach, isCascadeMerge, isCascadeOnDeleteSetOnDatabase, isCascadePersist, isCascadeRefresh, isCascadeRemove, isExtendingPessimisticLockScope, isForeignReferenceMapping, isInnerJoinFetched, isJoinFetched, isLazy, isLockableMapping, isOuterJoinFetched, isPrivateOwned, iterate, mergeRemoteValueHolder, preInitialize, 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, setSelectionSQLString, setShouldExtendPessimisticLockScope, setTempSession, setUsesBatchReading, setUsesIndirection, shouldExtendPessimisticLockScope, shouldExtendPessimisticLockScopeInDedicatedQuery, shouldExtendPessimisticLockScopeInSourceQuery, shouldExtendPessimisticLockScopeInTargetQuery, shouldForceInitializationOfSelectionCriteria, shouldInitializeSelectionCriteria, shouldMergeCascadeParts, shouldMergeCascadeReference, shouldRefreshCascadeParts, shouldUseBatchReading, shouldUseValueFromRowWithJoin, trimRowForJoin, trimRowForJoin, useBasicIndirection, useBatchReading, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection, valueFromRow, valueFromRowInternal, valueFromRowInternal
addUnconvertedProperty, buildExpression, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, cloneFields, collectFields, convertConverterClassNamesToClasses, derivesId, earlyPreDelete, extractNestedExpressions, 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, isCloningRequired, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isElementCollectionMapping, isInAndOutSopObject, isInOnlySopObject, isInSopObject, isJPAId, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isMultitenantPrimaryKeyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToOneMapping, isOptional, isOutOnlySopObject, isOutSopObject, isOwned, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, postCalculateChangesOnDeleted, 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, writeFromObjectIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowForUpdateAfterShallowInsert, writeFromObjectIntoRowForUpdateBeforeShallowDelete, writeFromObjectIntoRowForWhereClause, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow, writeUpdateFieldsIntoRow
protected static final java.lang.String PostInsert
protected static final java.lang.String ObjectRemoved
protected static final java.lang.String ObjectAdded
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> targetForeignKeyFields
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceKeyFields
protected transient java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> targetForeignKeysToSourceKeys
protected transient java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> sourceKeysToTargetForeignKeys
protected transient org.eclipse.persistence.internal.helper.DatabaseTable targetForeignKeyTable
protected transient java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> targetPrimaryKeyFields
protected DataModifyQuery addTargetQuery
protected boolean hasCustomAddTargetQuery
protected DataModifyQuery removeTargetQuery
protected boolean hasCustomRemoveTargetQuery
protected DataModifyQuery removeAllTargetsQuery
protected boolean hasCustomRemoveAllTargetsQuery
public boolean isRelationalMapping()
isRelationalMapping
in class DatabaseMapping
public void addTargetForeignKeyField(org.eclipse.persistence.internal.helper.DatabaseField targetForeignKeyField, org.eclipse.persistence.internal.helper.DatabaseField sourceKeyField)
addTargetForeignKeyField
in class ForeignReferenceMapping
public void addTargetForeignKeyFieldName(java.lang.String targetForeignKeyFieldName, java.lang.String sourceKeyFieldName)
protected void buildListOrderField()
buildListOrderField
in class CollectionMapping
protected Expression buildDefaultSelectionCriteriaAndAddFieldsToQuery()
public Expression buildSelectionCriteria()
public void collectQueryParameters(java.util.Set<org.eclipse.persistence.internal.helper.DatabaseField> cacheFields)
collectQueryParameters
in class CollectionMapping
public java.lang.Object clone()
clone
in interface MapComponentMapping
clone
in class CollectionMapping
public java.lang.Object createMapComponentFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord dbRow, ObjectBuildingQuery query, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean isTargetProtected)
createMapComponentFromRow
in interface MapComponentMapping
protected void deleteAll(DeleteObjectQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException
DatabaseException
protected void deleteReferenceObjectsLeftOnDatabase(DeleteObjectQuery query) throws DatabaseException, OptimisticLockException
protected java.lang.Object extractKeyFromTargetRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
extractKeyFromTargetRow
in class CollectionMapping
protected java.lang.Object extractBatchKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
extractBatchKeyFromRow
in class ForeignReferenceMapping
protected ModifyQuery getDeleteAllQuery()
getDeleteAllQuery
in class CollectionMapping
public java.util.Collection getFieldsForTranslationInAggregate()
getFieldsForTranslationInAggregate
in class ForeignReferenceMapping
public java.util.Vector getSourceKeyFieldNames()
public java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> getSourceKeyFields()
public java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> getSourceKeysToTargetForeignKeys()
public java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> getTargetPrimaryKeyFields()
getTargetPrimaryKeyFields
in class CollectionMapping
public java.util.Vector getTargetForeignKeyFieldNames()
public java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> getTargetForeignKeyFields()
public java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> getTargetForeignKeysToSourceKeys()
public java.util.Map getTargetForeignKeyToSourceKeys()
public boolean hasInverseConstraintDependency()
hasInverseConstraintDependency
in class DatabaseMapping
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
initialize
in class CollectionMapping
DescriptorException
protected void initializeAddTargetQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
protected org.eclipse.persistence.internal.sessions.AbstractRecord createModifyRowForAddTargetQuery()
protected void initializeChangeOrderTargetQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
initializeChangeOrderTargetQuery
in class CollectionMapping
protected void initializeDeleteAllQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
protected void initializeTargetPrimaryKeyFields()
protected void initializeRemoveTargetQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
protected void initializeReferenceDescriptor(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
initializeReferenceDescriptor
in class ForeignReferenceMapping
DescriptorException
protected void initializeRemoveAllTargetsQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
protected void initializeTargetForeignKeysToSourceKeys() throws DescriptorException
DescriptorException
public boolean isOneToManyMapping()
isOneToManyMapping
in class DatabaseMapping
protected boolean isSourceKeySpecified()
protected void objectAddedDuringUpdate(ObjectLevelModifyQuery query, java.lang.Object objectAdded, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, java.util.Map extraData) throws DatabaseException, OptimisticLockException
objectAddedDuringUpdate
in class CollectionMapping
DatabaseException
OptimisticLockException
protected void objectRemovedDuringUpdate(ObjectLevelModifyQuery query, java.lang.Object objectDeleted, java.util.Map extraData) throws DatabaseException, OptimisticLockException
objectRemovedDuringUpdate
in class CollectionMapping
DatabaseException
OptimisticLockException
public void performDataModificationEvent(java.lang.Object[] event, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException, DescriptorException
performDataModificationEvent
in class DatabaseMapping
DatabaseException
DescriptorException
public void postInsert(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
postInsert
in class CollectionMapping
DatabaseException
OptimisticLockException
public void postUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
postUpdate
in class DatabaseMapping
DatabaseException
OptimisticLockException
protected Expression buildBatchCriteria(ExpressionBuilder builder, ObjectLevelReadQuery query)
buildBatchCriteria
in class ForeignReferenceMapping
public void preDelete(DeleteObjectQuery query) throws DatabaseException, OptimisticLockException
preDelete
in class DatabaseMapping
DatabaseException
OptimisticLockException
public void prepareCascadeLockingPolicy()
prepareCascadeLockingPolicy
in class DatabaseMapping
public boolean requiresDataModificationEvents()
UnidirectionalOneToManyMapping
public void setCustomAddTargetQuery(DataModifyQuery query)
public void setAddTargetSQLString(java.lang.String sqlString)
public void setCustomRemoveTargetQuery(DataModifyQuery query)
public void setCustomRemoveAllTargetsQuery(DataModifyQuery query)
public void setDeleteAllSQLString(java.lang.String sqlString)
Example: "delete from PHONE where OWNER_ID = #EMPLOYEE_ID"
setDeleteAllSQLString
in class CollectionMapping
public void setSessionName(java.lang.String name)
setSessionName
in class CollectionMapping
public void setSourceKeyFieldNames(java.util.Vector fieldNames)
public void setSourceKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceKeyFields)
public void setTargetForeignKeyFieldName(java.lang.String targetForeignKeyFieldName)
public void setTargetForeignKeyFieldNames(java.lang.String[] targetForeignKeyFieldNames, java.lang.String[] sourceKeyFieldNames)
public void setTargetForeignKeyFieldNames(java.util.Vector fieldNames)
public void setTargetForeignKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> targetForeignKeyFields)
protected void setTargetForeignKeysToSourceKeys(java.util.Map<org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.helper.DatabaseField> targetForeignKeysToSourceKeys)
protected boolean shouldObjectModifyCascadeToParts(ObjectLevelModifyQuery query)
shouldObjectModifyCascadeToParts
in class ForeignReferenceMapping
protected boolean shouldRemoveTargetQueryModifyTargetForeignKey()
public boolean isCascadedLockingSupported()
isCascadedLockingSupported
in class DatabaseMapping
public boolean isJoiningSupported()
isJoiningSupported
in class ForeignReferenceMapping
public void updateTargetRowPostInsertSource(WriteObjectQuery query) throws DatabaseException
DatabaseException
protected org.eclipse.persistence.internal.sessions.AbstractRecord buildKeyRowForTargetUpdate(ObjectLevelModifyQuery query)
public void updateTargetForeignKeyPostUpdateSource_ObjectAdded(ObjectLevelModifyQuery query, java.lang.Object objectAdded, java.util.Map extraData) throws DatabaseException
- 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.
DatabaseException
public void updateTargetForeignKeyPostUpdateSource_ObjectRemoved(ObjectLevelModifyQuery query, java.lang.Object objectRemoved) throws DatabaseException
- 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.
DatabaseException
public void updateTargetRowPreDeleteSource(ObjectLevelModifyQuery query) throws DatabaseException
- 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.
DatabaseException
public boolean verifyDelete(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException
verifyDelete
in class CollectionMapping
DatabaseException