Module org.eclipse.persistence.core
Package org.eclipse.persistence.mappings
Class ObjectReferenceMapping
java.lang.Object
org.eclipse.persistence.core.mappings.CoreMapping<AttributeAccessor,AbstractSession,ContainerPolicy,ClassDescriptor,DatabaseField>
org.eclipse.persistence.mappings.DatabaseMapping
org.eclipse.persistence.mappings.ForeignReferenceMapping
org.eclipse.persistence.mappings.ObjectReferenceMapping
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
EISOneToOneMapping
,OneToOneMapping
,ReferenceMapping
,VariableOneToOneMapping
Purpose: Abstract class for 1:1, variable 1:1 and reference mappings
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.persistence.mappings.DatabaseMapping
DatabaseMapping.WriteType
-
Field Summary
Modifier and TypeFieldDescriptionprotected Vector
<DatabaseField> Keeps track of which fields are foreign keys on a per field basis (can have mixed foreign key relationships).protected boolean
Keeps track if any of the fields are foreign keys.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 TypeMethodDescriptionbuildBackupCloneForPartObject
(Object attributeValue, Object clone, Object backup, UnitOfWorkImpl unitOfWork) INTERNAL: Used during building the backup shallow copy to copy the vector without re-registering the target objects.buildChangeRecord
(Object clone, ObjectChangeSet owner, AbstractSession session) INTERNAL: Directly build a change record without comparisonbuildCloneForPartObject
(Object attributeValue, Object original, CacheKey cacheKey, Object clone, AbstractSession cloningSession, Integer refreshCascade, boolean isExisting, boolean isFromSharedCache) INTERNAL: Require for cloning, the part must be cloned.void
INTERNAL: Copy of the attribute of the object.buildExpression
(Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, Map processedObjects, AbstractSession session) INTERNAL: In case Query By Example is used, this method generates an expression from a attribute value pair.Object[]
buildReferencesPKList
(Object entity, Object attribute, AbstractSession session) INTERNAL: This method will access the target relationship and create a list of PKs of the target entities.buildTargetInterfaces
(Class<?> aClass, Collection targetInterfacesCol) INTERNAL: Build a list of all the interfaces and super interfaces for a given class.buildUnitofWorkCloneForPartObject
(Object attributeValue, Object original, Object clone, Integer refreshCascade, UnitOfWorkImpl unitOfWork, boolean isExisting) INTERNAL: Require for cloning, the part must be cloned.void
cascadeDiscoverAndPersistUnregisteredNewObjects
(Object object, Map newObjects, Map unregisteredExistingObjects, Map visitedObjects, UnitOfWorkImpl uow, boolean getAttributeValueFromObject, Set cascadeErrors) INTERNAL: Cascade discover and persist new objects during commit.void
cascadeDiscoverAndPersistUnregisteredNewObjects
(Object object, Map newObjects, Map unregisteredExistingObjects, Map visitedObjects, UnitOfWorkImpl uow, Set cascadeErrors) INTERNAL: Cascade discover and persist new objects during commit.void
cascadePerformRemoveIfRequired
(Object object, UnitOfWorkImpl uow, Map visitedObjects) INTERNAL: Cascade registerNew for Create through mappings that require the cascadevoid
cascadePerformRemoveIfRequired
(Object object, UnitOfWorkImpl uow, Map visitedObjects, boolean getAttributeValueFromObject) INTERNAL: Cascade remove through mappings that require the cascade.void
cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired
(Object object, UnitOfWorkImpl uow, Map visitedObjects) INTERNAL: Cascade removal of orphaned private owned objects from the UnitOfWorkChangeSetvoid
cascadeRegisterNewIfRequired
(Object object, UnitOfWorkImpl uow, Map visitedObjects) INTERNAL: Cascade registerNew for Create through mappings that require the cascadevoid
cascadeRegisterNewIfRequired
(Object object, UnitOfWorkImpl uow, Map visitedObjects, boolean getAttributeValueFromObject) INTERNAL: Cascade registerNew for Create through mappings that require the cascadeprotected Vector
<DatabaseField> INTERNAL: Return all the fields populated by this mapping, these are foreign keys only.void
collectQueryParameters
(Set<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 entitycompareForChange
(Object clone, Object backUp, ObjectChangeSet owner, AbstractSession session) INTERNAL: Return an ObjectReferenceChangeRecord describing the change, or null if no change.protected boolean
compareObjectsWithoutPrivateOwned
(Object firstObject, Object secondObject, AbstractSession session) INTERNAL: Compare the references of the two objects are the same, not the objects themselves.protected boolean
compareObjectsWithPrivateOwned
(Object firstObject, Object secondObject, AbstractSession session) INTERNAL: Compare the references of the two objects are the same, and the objects themselves are the same.<T> DatabaseValueHolder
<T> createCloneValueHolder
(ValueHolderInterface<T> attributeValue, Object original, Object clone, AbstractRecord row, AbstractSession cloningSession, boolean buildDirectlyFromRow) INTERNAL: Builder the unit of work value holder.void
earlyPreDelete
(DeleteObjectQuery query, Object object) INTERNAL: Record deletion dependencies for foreign key constraints.extractPrimaryKeyRowForSourceObject
(Object domainObject, AbstractSession session) INTERNAL: Extract the reference pk for rvh usage in remote model.extractPrimaryKeysForReferenceObject
(Object domainObject, AbstractSession session) INTERNAL: Extract the reference pk for rvh usage in remote model.INTERNAL: Return the primary key for the reference object (i.e.extractPrimaryKeysFromRealReferenceObject
(Object object, AbstractSession session) INTERNAL: Extract the reference pk for rvh usage in remote model.void
fixRealObjectReferences
(Object object, Map<Object, ObjectDescriptor> objectDescriptors, Map<Object, Object> processedObjects, ObjectLevelReadQuery query, DistributedSession session) INTERNAL: We are not using a remote valueholder so we need to replace the reference object(s) with the corresponding object(s) from the remote session.getDescriptorForTarget
(Object object, AbstractSession session) INTERNAL: Return a descriptor for the target of this mappingINTERNAL: Returns the foreign key names associated with the mapping.protected Object
getPrimaryKeyForObject
(Object object, AbstractSession session) INTERNAL:getRealAttributeValueFromAttribute
(Object attributeValue, Object object, AbstractSession session) INTERNAL: Object reference must unwrap the reference object if required.boolean
INTERNAL: The returns if the mapping has any constraint dependencies, such as foreign keys and join tables.boolean
PUBLIC: Indicates whether the mapping has RelationTableMechanism.protected void
insert
(WriteObjectQuery query) INTERNAL: Insert privately owned partsinternalBuildChangeRecord
(Object newValue, ObjectChangeSet owner, AbstractSession session) INTERNAL: Directly build a change record based on the newValue without comparisonboolean
isChangeTrackingSupported
(Project project) INTERNAL: Return if this mapping supports change tracking.boolean
INTERNAL: Return if the 1-1 mapping has a foreign key dependency to its target.boolean
INTERNAL: Related mapping should implement this method to return true.void
iterateOnRealAttributeValue
(DescriptorIterator iterator, Object realAttributeValue) INTERNAL: Iterate on the attribute value.void
loadAll
(Object object, AbstractSession session, IdentityHashSet loaded) Force instantiation of all indirections.void
mergeChangesIntoObject
(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession) INTERNAL: Merge changes from the source to the target object.void
mergeIntoObject
(Object target, boolean isTargetUnInitialized, Object source, MergeManager mergeManager, AbstractSession targetSession) INTERNAL: Merge changes from the source to the target object.void
postCalculateChanges
(ChangeRecord changeRecord, UnitOfWorkImpl uow) INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.void
postDelete
(DeleteObjectQuery query) INTERNAL: Delete privately owned partsvoid
postInsert
(WriteObjectQuery query) INTERNAL: Insert privately owned partsvoid
postUpdate
(WriteObjectQuery query) INTERNAL: Update privately owned partsvoid
preDelete
(DeleteObjectQuery query) INTERNAL: Delete privately owned partsvoid
preInitialize
(AbstractSession session) INTERNAL: Initialize the state of mapping.void
preInsert
(WriteObjectQuery query) INTERNAL: Insert privately owned partsvoid
preUpdate
(WriteObjectQuery query) INTERNAL: Update privately owned partsprotected Object
readPrivateOwnedForObject
(ObjectLevelModifyQuery modifyQuery) INTERNAL: Reads the private owned object.void
recordPrivateOwnedRemovals
(Object object, UnitOfWorkImpl uow) INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.protected void
setForeignKeyFields
(Vector<DatabaseField> foreignKeyFields) INTERNAL: Set the foreign key fields associated with the mapping.void
setIsForeignKeyRelationship
(boolean isForeignKeyRelationship) INTERNAL: Set if the 1-1 mapping has a foreign key dependency to its target.void
setNewValueInChangeRecord
(Object newValue, ObjectReferenceChangeRecord changeRecord, ObjectChangeSet owner, AbstractSession session) INTERNAL: Set the newValue in the change recordprotected void
update
(WriteObjectQuery query) INTERNAL: Update the private owned part.void
updateChangeRecord
(Object clone, Object newValue, Object oldValue, ObjectChangeSet objectChangeSet, UnitOfWorkImpl uow) INTERNAL: Either create a new change record or update the change record with the new value.void
updateChangeRecordForSelfMerge
(ChangeRecord changeRecord, Object source, Object target, UnitOfWorkChangeSet parentUOWChangeSet, UnitOfWorkImpl unitOfWork) INTERNAL: Update a ChangeRecord to replace the ChangeSet for the old entity with the changeSet for the new Entity.void
PUBLIC: Set this mapping to use Proxy Indirection.void
useProxyIndirection
(Class<?> targetInterface) PUBLIC: Set this mapping to use Proxy Indirection.void
useProxyIndirection
(Class<?>[] targetInterfaces) PUBLIC: Set this mapping to use Proxy Indirection.valueFromPKList
(Object[] pks, AbstractRecord foreignKeys, AbstractSession session) INTERNAL: This method is used to load a relationship from a list of PKs.boolean
verifyDelete
(Object object, AbstractSession session) INTERNAL: To verify if the specified object is deleted or not.void
writeFromObjectIntoRowForUpdate
(WriteObjectQuery query, AbstractRecord databaseRow) INTERNAL: Get a value from the object and set that in the respective field of the row.void
writeFromObjectIntoRowForWhereClause
(ObjectLevelModifyQuery query, AbstractRecord databaseRow) INTERNAL: Get a value from the object and set that in the respective field of the row.Methods inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
addForeignKeyField, addTargetForeignKeyField, batchedValueFromRow, buildBackupClone, buildBatchCriteria, buildClone, buildCloneFromRow, checkCacheForBatchKey, clone, compareObjects, convertClassNamesToClasses, dontDoMerge, dontUseBatchReading, dontUseIndirection, executeBatchQuery, extendPessimisticLockScopeInSourceQuery, extendPessimisticLockScopeInTargetQuery, extractBatchKeyFromRow, extractResultFromBatchQuery, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getBatchFetchType, getExtendPessimisticLockScopeDedicatedQuery, getFieldsForTranslationInAggregate, getIndirectionPolicy, getJoinCriteria, getJoinFetch, getMappedBy, getObjectCorrespondingTo, getOrderByNormalizedExpressions, getPartitioningPolicy, getPartitioningPolicyName, getReferenceClass, getReferenceClassName, getReferenceDescriptor, getRelationshipPartner, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getTempSession, getValueFromRemoteValueHolder, hasCustomSelectionQuery, hasDependency, hasNestedIdentityReference, initialize, initializeReferenceDescriptor, initializeSelectionQuery, instantiateAttribute, isAttributeValueFromObjectInstantiated, isAttributeValueFullyBuilt, isAttributeValueInstantiated, isCascadeDetach, isCascadeMerge, isCascadeOnDeleteSetOnDatabase, isCascadePersist, isCascadeRefresh, isCascadeRemove, isExtendingPessimisticLockScope, isForeignReferenceMapping, isInnerJoinFetched, isJoinFetched, isJoiningSupported, isLazy, isLockableMapping, isOuterJoinFetched, isPrivateOwned, iterate, load, mergeRemoteValueHolder, postPrepareNestedBatchQuery, prepareHistoricalQuery, prepareNestedBatchQuery, prepareNestedJoinQueryClone, prepareNestedJoins, privateOwnedRelationship, readFromRowIntoObject, remoteInitialization, replaceValueHoldersIn, 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, shouldObjectModifyCascadeToParts, shouldRefreshCascadeParts, shouldUseBatchReading, shouldUseValueFromRowWithJoin, trimRowForJoin, trimRowForJoin, useBasicIndirection, useBatchReading, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection, validateBeforeInitialization, valueFromRow, valueFromRowInternal, valueFromRowInternal, valueFromRowInternalWithJoin
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
addUnconvertedProperty, buildContainerClone, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, calculateDeferredChanges, cloneFields, convertConverterClassNamesToClasses, derivesId, extractNestedExpressions, extractNestedNonAggregateExpressions, getAttributeAccessor, getAttributeClassification, getAttributeName, getContainerPolicy, getDerivedIdMapping, getDescriptor, getField, getFieldClassification, getFields, getGetMethodName, getMapsIdValue, getProperties, getProperty, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, getSelectFields, getSelectTables, getSetMethodName, getUnconvertedProperties, getWeight, hasInverseConstraintDependency, hasMapsIdValue, hasRootExpressionThatShouldUseOuterJoin, hasUnconvertedProperties, isAbstractColumnMapping, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCacheable, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isCloningRequired, isCollectionMapping, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isElementCollectionMapping, isInAndOutSopObject, isInOnlySopObject, isInSopObject, isJPAId, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isMultitenantPrimaryKeyMapping, isNestedTableMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOutOnlySopObject, isOutSopObject, isOwned, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isRelationalMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, performDataModificationEvent, postCalculateChangesOnDeleted, postInitialize, postInitializeSourceAndTargetExpressions, prepareCascadeLockingPolicy, readFromResultSetIntoObject, readOnly, readWrite, rehashFieldDependancies, remotelyInitialized, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setChangeListener, setDerivedIdMapping, setDerivesId, setDescriptor, setFields, setGetMethodName, setIsInAndOutSopObject, setIsInSopObject, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsOutSopObject, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, toString, updateCollectionChangeRecord, validateAfterInitialization, valueFromObject, valueFromResultSet, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForUpdateAfterShallowInsert, writeFromObjectIntoRowForUpdateBeforeShallowDelete, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow, writeUpdateFieldsIntoRow
-
Field Details
-
isForeignKeyRelationship
protected boolean isForeignKeyRelationshipKeeps track if any of the fields are foreign keys. -
foreignKeyFields
Keeps track of which fields are foreign keys on a per field basis (can have mixed foreign key relationships).
-
-
Constructor Details
-
ObjectReferenceMapping
protected ObjectReferenceMapping()
-
-
Method Details
-
buildBackupCloneForPartObject
public Object buildBackupCloneForPartObject(Object attributeValue, Object clone, Object backup, UnitOfWorkImpl unitOfWork) INTERNAL: Used during building the backup shallow copy to copy the vector without re-registering the target objects. For 1-1 or ref the reference is from the clone so it is already registered.- Specified by:
buildBackupCloneForPartObject
in classForeignReferenceMapping
- Parameters:
attributeValue
- TODOclone
- TODObackup
- TODOunitOfWork
- TODO- Returns:
- TODO
-
buildCloneForPartObject
public Object buildCloneForPartObject(Object attributeValue, Object original, CacheKey cacheKey, Object clone, AbstractSession cloningSession, Integer refreshCascade, boolean isExisting, boolean isFromSharedCache) INTERNAL: Require for cloning, the part must be cloned. Ignore the objects, use the attribute value.- Specified by:
buildCloneForPartObject
in classForeignReferenceMapping
- Parameters:
attributeValue
- TODOoriginal
- TODOcacheKey
- TODOclone
- TODOcloningSession
- TODOrefreshCascade
- TODOisExisting
- TODOisFromSharedCache
- TODO- Returns:
- TODO
-
buildUnitofWorkCloneForPartObject
public Object buildUnitofWorkCloneForPartObject(Object attributeValue, Object original, Object clone, Integer refreshCascade, UnitOfWorkImpl unitOfWork, boolean isExisting) INTERNAL: Require for cloning, the part must be cloned. Ignore the objects, use the attribute value. -
buildCopy
INTERNAL: Copy of the attribute of the object. This is NOT used for unit of work but for templatizing an object.- Overrides:
buildCopy
in classDatabaseMapping
- Parameters:
copy
- TODOoriginal
- TODOgroup
- TODO
-
buildExpression
public Expression buildExpression(Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, Map processedObjects, AbstractSession session) INTERNAL: In case Query By Example is used, this method generates an expression from a attribute value pair. Since this is a ObjectReference mapping, a recursive call is made to the buildExpressionFromExample method of ObjectBuilder.- Overrides:
buildExpression
in classDatabaseMapping
- Parameters:
queryObject
- TODOpolicy
- TODOexpressionBuilder
- TODOprocessedObjects
- TODOsession
- TODO- Returns:
- TODO
-
compareForChange
public ChangeRecord compareForChange(Object clone, Object backUp, ObjectChangeSet owner, AbstractSession session) INTERNAL: Return an ObjectReferenceChangeRecord describing the change, or null if no change. Used to compute changes for deferred change tracking.- Specified by:
compareForChange
in classDatabaseMapping
- Parameters:
clone
- TODObackUp
- TODOowner
- TODOsession
- TODO- Returns:
- prototype.changeset.ChangeRecord TODO
-
internalBuildChangeRecord
public ObjectReferenceChangeRecord internalBuildChangeRecord(Object newValue, ObjectChangeSet owner, AbstractSession session) INTERNAL: Directly build a change record based on the newValue without comparison -
setNewValueInChangeRecord
public void setNewValueInChangeRecord(Object newValue, ObjectReferenceChangeRecord changeRecord, ObjectChangeSet owner, AbstractSession session) INTERNAL: Set the newValue in the change record -
compareObjectsWithoutPrivateOwned
protected boolean compareObjectsWithoutPrivateOwned(Object firstObject, Object secondObject, AbstractSession session) INTERNAL: Compare the references of the two objects are the same, not the objects themselves. Used for independent relationships. This is used for testing and validation purposes.- Specified by:
compareObjectsWithoutPrivateOwned
in classForeignReferenceMapping
-
compareObjectsWithPrivateOwned
protected boolean compareObjectsWithPrivateOwned(Object firstObject, Object secondObject, AbstractSession session) INTERNAL: Compare the references of the two objects are the same, and the objects themselves are the same. Used for private relationships. This is used for testing and validation purposes.- Specified by:
compareObjectsWithPrivateOwned
in classForeignReferenceMapping
-
fixRealObjectReferences
public void fixRealObjectReferences(Object object, Map<Object, ObjectDescriptor> objectDescriptors, Map<Object, Object> processedObjects, ObjectLevelReadQuery query, DistributedSession session) INTERNAL: We are not using a remote valueholder so we need to replace the reference object(s) with the corresponding object(s) from the remote session. ObjectReferenceMappings need to unwrap and wrap the reference object.- Overrides:
fixRealObjectReferences
in classDatabaseMapping
- Parameters:
object
- TODOobjectDescriptors
- TODOprocessedObjects
- TODOquery
- TODOsession
- TODO
-
getDescriptorForTarget
INTERNAL: Return a descriptor for the target of this mapping- See Also:
-
getRealAttributeValueFromAttribute
public Object getRealAttributeValueFromAttribute(Object attributeValue, Object object, AbstractSession session) INTERNAL: Object reference must unwrap the reference object if required.- Overrides:
getRealAttributeValueFromAttribute
in classForeignReferenceMapping
-
isObjectReferenceMapping
public boolean isObjectReferenceMapping()INTERNAL: Related mapping should implement this method to return true.- Overrides:
isObjectReferenceMapping
in classDatabaseMapping
-
iterateOnRealAttributeValue
INTERNAL: Iterate on the attribute value. The value holder has already been processed.- Specified by:
iterateOnRealAttributeValue
in classForeignReferenceMapping
-
loadAll
Force instantiation of all indirections.- Overrides:
loadAll
in classDatabaseMapping
-
mergeChangesIntoObject
public void mergeChangesIntoObject(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession) INTERNAL: Merge changes from the source to the target object. Which is the original from the parent UnitOfWork- Specified by:
mergeChangesIntoObject
in classDatabaseMapping
-
mergeIntoObject
public void mergeIntoObject(Object target, boolean isTargetUnInitialized, Object source, MergeManager mergeManager, AbstractSession targetSession) INTERNAL: Merge changes from the source to the target object.- Specified by:
mergeIntoObject
in classDatabaseMapping
-
collectFields
INTERNAL: Return all the fields populated by this mapping, these are foreign keys only.- Overrides:
collectFields
in classDatabaseMapping
- Returns:
- TODO
-
getForeignKeyFields
INTERNAL: Returns the foreign key names associated with the mapping. These are the fields that will be populated by the 1-1 mapping when writing. -
setForeignKeyFields
INTERNAL: Set the foreign key fields associated with the mapping. These are the fields that will be populated by the 1-1 mapping when writing. -
isForeignKeyRelationship
public boolean isForeignKeyRelationship()INTERNAL: Return if the 1-1 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-1 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. -
preInsert
INTERNAL: Insert privately owned parts- Overrides:
preInsert
in classDatabaseMapping
- Throws:
DatabaseException
OptimisticLockException
-
readPrivateOwnedForObject
protected Object readPrivateOwnedForObject(ObjectLevelModifyQuery modifyQuery) throws DatabaseException INTERNAL: Reads the private owned object.- Throws:
DatabaseException
-
preUpdate
INTERNAL: Update privately owned parts- Overrides:
preUpdate
in classDatabaseMapping
- Throws:
DatabaseException
OptimisticLockException
-
postCalculateChanges
INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.- Overrides:
postCalculateChanges
in classDatabaseMapping
-
recordPrivateOwnedRemovals
INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.- Overrides:
recordPrivateOwnedRemovals
in classDatabaseMapping
-
postDelete
INTERNAL: Delete privately owned parts- Overrides:
postDelete
in classDatabaseMapping
- Throws:
DatabaseException
OptimisticLockException
-
postInsert
INTERNAL: Insert privately owned parts- Overrides:
postInsert
in classDatabaseMapping
- Throws:
DatabaseException
OptimisticLockException
-
postUpdate
INTERNAL: Update privately owned parts- Overrides:
postUpdate
in classDatabaseMapping
- Throws:
DatabaseException
OptimisticLockException
-
preDelete
INTERNAL: Delete privately owned parts- Overrides:
preDelete
in classDatabaseMapping
- Throws:
DatabaseException
OptimisticLockException
-
earlyPreDelete
INTERNAL: Record deletion dependencies for foreign key constraints. This is used during deletion to resolve deletion cycles.- Overrides:
earlyPreDelete
in classDatabaseMapping
- Parameters:
query
- TODOobject
- TODO
-
cascadePerformRemoveIfRequired
INTERNAL: Cascade registerNew for Create through mappings that require the cascade- Specified by:
cascadePerformRemoveIfRequired
in classDatabaseMapping
- Parameters:
object
- TODOuow
- TODOvisitedObjects
- TODO
-
cascadePerformRemoveIfRequired
public void cascadePerformRemoveIfRequired(Object object, UnitOfWorkImpl uow, Map visitedObjects, boolean getAttributeValueFromObject) INTERNAL: Cascade remove through mappings that require the cascade.- Parameters:
object
- is either the source object, or attribute value if getAttributeValueFromObject is true.
-
cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired
public void cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired(Object object, UnitOfWorkImpl uow, Map visitedObjects) INTERNAL: Cascade removal of orphaned private owned objects from the UnitOfWorkChangeSet- Overrides:
cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired
in classDatabaseMapping
- Parameters:
object
- TODOuow
- TODOvisitedObjects
- TODO
-
collectQueryParameters
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- Specified by:
collectQueryParameters
in classForeignReferenceMapping
- Parameters:
cacheFields
- TODO
-
cascadeDiscoverAndPersistUnregisteredNewObjects
public void cascadeDiscoverAndPersistUnregisteredNewObjects(Object object, Map newObjects, Map unregisteredExistingObjects, Map visitedObjects, UnitOfWorkImpl uow, Set cascadeErrors) INTERNAL: Cascade discover and persist new objects during commit.- Overrides:
cascadeDiscoverAndPersistUnregisteredNewObjects
in classDatabaseMapping
- Parameters:
object
- TODOnewObjects
- TODOunregisteredExistingObjects
- TODOvisitedObjects
- TODOuow
- TODOcascadeErrors
- TODO
-
cascadeDiscoverAndPersistUnregisteredNewObjects
public void cascadeDiscoverAndPersistUnregisteredNewObjects(Object object, Map newObjects, Map unregisteredExistingObjects, Map visitedObjects, UnitOfWorkImpl uow, boolean getAttributeValueFromObject, Set cascadeErrors) INTERNAL: Cascade discover and persist new objects during commit. -
cascadeRegisterNewIfRequired
INTERNAL: Cascade registerNew for Create through mappings that require the cascade- Specified by:
cascadeRegisterNewIfRequired
in classDatabaseMapping
- Parameters:
object
- TODOuow
- TODOvisitedObjects
- TODO
-
cascadeRegisterNewIfRequired
public void cascadeRegisterNewIfRequired(Object object, UnitOfWorkImpl uow, Map visitedObjects, boolean getAttributeValueFromObject) INTERNAL: Cascade registerNew for Create through mappings that require the cascade- Parameters:
object
- is either the source object, or attribute value if getAttributeValueFromObject is true.
-
getPrimaryKeyForObject
INTERNAL: -
hasConstraintDependency
public boolean hasConstraintDependency()INTERNAL: The returns if the mapping has any constraint dependencies, such as foreign keys and join tables.- Overrides:
hasConstraintDependency
in classDatabaseMapping
-
createCloneValueHolder
public <T> DatabaseValueHolder<T> createCloneValueHolder(ValueHolderInterface<T> attributeValue, Object original, Object clone, AbstractRecord row, AbstractSession cloningSession, boolean buildDirectlyFromRow) INTERNAL: Builder the unit of work value holder.- Overrides:
createCloneValueHolder
in classForeignReferenceMapping
- Parameters:
attributeValue
- TODOoriginal
- TODOclone
- TODOrow
- TODOcloningSession
- TODObuildDirectlyFromRow
- indicates that we are building the clone directly from a row as opposed to building the original from the row, putting it in the shared cache, and then cloning the original.- Returns:
- TODO
-
extractPrimaryKeyRowForSourceObject
public AbstractRecord extractPrimaryKeyRowForSourceObject(Object domainObject, AbstractSession session) INTERNAL: Extract the reference pk for rvh usage in remote model. -
extractPrimaryKeysForReferenceObject
INTERNAL: Extract the reference pk for rvh usage in remote model. -
extractPrimaryKeysForReferenceObjectFromRow
INTERNAL: Return the primary key for the reference object (i.e. the object object referenced by domainObject and specified by mapping). This key will be used by a RemoteValueHolder. -
extractPrimaryKeysFromRealReferenceObject
INTERNAL: Extract the reference pk for rvh usage in remote model. -
preInitialize
INTERNAL: Initialize the state of mapping.- Overrides:
preInitialize
in classForeignReferenceMapping
- Throws:
DescriptorException
-
insert
INTERNAL: Insert privately owned parts -
update
INTERNAL: Update the private owned part. -
hasRelationTableMechanism
public boolean hasRelationTableMechanism()PUBLIC: Indicates whether the mapping has RelationTableMechanism. -
useProxyIndirection
public void useProxyIndirection()PUBLIC: Set this mapping to use Proxy Indirection. Proxy Indirection uses theProxy
andInvocationHandler
features of JDK 1.3 to provide "transparent indirection" for 1:1 relationships. In order to use Proxy Indirection:- The target class must implement at least one public interface
- The attribute on the source class must be typed as that public interface
- get() and set() methods for the attribute must use the interface
toString
is called on the proxy the real object data is retrieved from the database. By default, use the target class' full list of interfaces for the proxy. -
buildReferencesPKList
INTERNAL: This method will access the target relationship and create a list of PKs of the target entities. This method is used in combination with the CachedValueHolder to store references to PK's to be loaded from a cache instead of a query.- Specified by:
buildReferencesPKList
in classForeignReferenceMapping
- See Also:
-
buildTargetInterfaces
INTERNAL: Build a list of all the interfaces and super interfaces for a given class. -
useProxyIndirection
PUBLIC: Set this mapping to use Proxy Indirection. Proxy Indirection uses theProxy
andInvocationHandler
features of JDK 1.3 to provide "transparent indirection" for 1:1 relationships. In order to use Proxy Indirection:- The target class must implement at least one public interface
- The attribute on the source class must be typed as that public interface
- get() and set() methods for the attribute must use the interface
toString
is called on the proxy the real object data is retrieved from the database.- Parameters:
targetInterfaces
- The interfaces that the target class implements. The attribute must be typed as one of these interfaces.
-
useProxyIndirection
PUBLIC: Set this mapping to use Proxy Indirection. Proxy Indirection uses theProxy
andInvocationHandler
features of JDK 1.3 to provide "transparent indirection" for 1:1 relationships. In order to use Proxy Indirection:- The target class must implement at least one public interface
- The attribute on the source class must be typed as that public interface
- get() and set() methods for the attribute must use the interface
toString
is called on the proxy the real object data is retrieved from the database.- Parameters:
targetInterface
- The interface that the target class implements. The attribute must be typed as this interface.
-
valueFromPKList
INTERNAL: This method is used to load a relationship from a list of PKs. This list may be available if the relationship has been cached.- Specified by:
valueFromPKList
in classForeignReferenceMapping
-
verifyDelete
INTERNAL: To verify if the specified object is deleted or not.- Overrides:
verifyDelete
in classDatabaseMapping
- Throws:
DatabaseException
-
writeFromObjectIntoRowForUpdate
INTERNAL: Get a value from the object and set that in the respective field of the row. But before that check if the reference object is instantiated or not.- Overrides:
writeFromObjectIntoRowForUpdate
in classDatabaseMapping
-
writeFromObjectIntoRowForWhereClause
public void writeFromObjectIntoRowForWhereClause(ObjectLevelModifyQuery query, AbstractRecord databaseRow) INTERNAL: Get a value from the object and set that in the respective field of the row.- Overrides:
writeFromObjectIntoRowForWhereClause
in classDatabaseMapping
-
isChangeTrackingSupported
INTERNAL: Return if this mapping supports change tracking.- Overrides:
isChangeTrackingSupported
in classDatabaseMapping
-
updateChangeRecord
public void updateChangeRecord(Object clone, Object newValue, Object oldValue, ObjectChangeSet objectChangeSet, UnitOfWorkImpl uow) INTERNAL: Either create a new change record or update the change record with the new value. This is used by attribute change tracking.- Overrides:
updateChangeRecord
in classDatabaseMapping
-
updateChangeRecordForSelfMerge
public void updateChangeRecordForSelfMerge(ChangeRecord changeRecord, Object source, Object target, UnitOfWorkChangeSet parentUOWChangeSet, UnitOfWorkImpl unitOfWork) INTERNAL: Update a ChangeRecord to replace the ChangeSet for the old entity with the changeSet for the new Entity. This is used when an Entity is merged into itself and the Entity reference new or detached entities.- Specified by:
updateChangeRecordForSelfMerge
in classForeignReferenceMapping
-
buildChangeRecord
INTERNAL: Directly build a change record without comparison- Overrides:
buildChangeRecord
in classDatabaseMapping
-