Package org.eclipse.persistence.mappings
Class ObjectReferenceMapping
- 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.ObjectReferenceMapping
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
EISOneToOneMapping,OneToOneMapping,ReferenceMapping,VariableOneToOneMapping
public abstract class ObjectReferenceMapping extends ForeignReferenceMapping
Purpose: Abstract class for 1:1, variable 1:1 and reference mappings
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.persistence.mappings.DatabaseMapping
DatabaseMapping.WriteType
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField>foreignKeyFieldsKeeps track of which fields are foreign keys on a per field basis (can have mixed foreign key relationships).protected booleanisForeignKeyRelationshipKeeps 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
Constructors Modifier Constructor Description protectedObjectReferenceMapping()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectbuildBackupCloneForPartObject(java.lang.Object attributeValue, java.lang.Object clone, java.lang.Object backup, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)INTERNAL: Used during building the backup shallow copy to copy the vector without re-registering the target objects.org.eclipse.persistence.internal.sessions.ChangeRecordbuildChangeRecord(java.lang.Object clone, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Directly build a change record without comparisonjava.lang.ObjectbuildCloneForPartObject(java.lang.Object attributeValue, java.lang.Object original, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, java.lang.Object clone, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession, java.lang.Integer refreshCascade, boolean isExisting, boolean isFromSharedCache)INTERNAL: Require for cloning, the part must be cloned.voidbuildCopy(java.lang.Object copy, java.lang.Object original, CopyGroup group)INTERNAL: Copy of the attribute of the object.ExpressionbuildExpression(java.lang.Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, java.util.Map processedObjects, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: In case Query By Example is used, this method generates an expression from a attribute value pair.java.lang.Object[]buildReferencesPKList(java.lang.Object entity, java.lang.Object attribute, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: This method will access the target relationship and create a list of PKs of the target entities.java.util.CollectionbuildTargetInterfaces(java.lang.Class aClass, java.util.Collection targetInterfacesCol)INTERNAL: Build a list of all the interfaces and super interfaces for a given class.java.lang.ObjectbuildUnitofWorkCloneForPartObject(java.lang.Object attributeValue, java.lang.Object original, java.lang.Object clone, java.lang.Integer refreshCascade, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, boolean isExisting)INTERNAL: Require for cloning, the part must be cloned.voidcascadeDiscoverAndPersistUnregisteredNewObjects(java.lang.Object object, java.util.Map newObjects, java.util.Map unregisteredExistingObjects, java.util.Map visitedObjects, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, boolean getAttributeValueFromObject, java.util.Set cascadeErrors)INTERNAL: Cascade discover and persist new objects during commit.voidcascadeDiscoverAndPersistUnregisteredNewObjects(java.lang.Object object, java.util.Map newObjects, java.util.Map unregisteredExistingObjects, java.util.Map visitedObjects, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Set cascadeErrors)INTERNAL: Cascade discover and persist new objects during commit.voidcascadePerformRemoveIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)INTERNAL: Cascade registerNew for Create through mappings that require the cascadevoidcascadePerformRemoveIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects, boolean getAttributeValueFromObject)INTERNAL: Cascade remove through mappings that require the cascade.voidcascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)INTERNAL: Cascade removal of orphaned private owned objects from the UnitOfWorkChangeSetvoidcascadeRegisterNewIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)INTERNAL: Cascade registerNew for Create through mappings that require the cascadevoidcascadeRegisterNewIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects, boolean getAttributeValueFromObject)INTERNAL: Cascade registerNew for Create through mappings that require the cascadeprotected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField>collectFields()INTERNAL: Return all the fields populated by this mapping, these are foreign keys only.voidcollectQueryParameters(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 entityorg.eclipse.persistence.internal.sessions.ChangeRecordcompareForChange(java.lang.Object clone, java.lang.Object backUp, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Return an ObjectReferenceChangeRecord describing the change, or null if no change.protected booleancompareObjectsWithoutPrivateOwned(java.lang.Object firstObject, java.lang.Object secondObject, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Compare the references of the two objects are the same, not the objects themselves.protected booleancompareObjectsWithPrivateOwned(java.lang.Object firstObject, java.lang.Object secondObject, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Compare the references of the two objects are the same, and the objects themselves are the same.org.eclipse.persistence.internal.indirection.DatabaseValueHoldercreateCloneValueHolder(ValueHolderInterface attributeValue, java.lang.Object original, java.lang.Object clone, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession, boolean buildDirectlyFromRow)INTERNAL: Builder the unit of work value holder.voidearlyPreDelete(DeleteObjectQuery query, java.lang.Object object)INTERNAL: Record deletion dependencies for foreign key constraints.org.eclipse.persistence.internal.sessions.AbstractRecordextractPrimaryKeyRowForSourceObject(java.lang.Object domainObject, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Extract the reference pk for rvh usage in remote model.java.lang.ObjectextractPrimaryKeysForReferenceObject(java.lang.Object domainObject, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Extract the reference pk for rvh usage in remote model.java.lang.ObjectextractPrimaryKeysForReferenceObjectFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row)INTERNAL: Return the primary key for the reference object (i.e. the object object referenced by domainObject and specified by mapping).java.lang.ObjectextractPrimaryKeysFromRealReferenceObject(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Extract the reference pk for rvh usage in remote model.voidfixRealObjectReferences(java.lang.Object object, java.util.Map objectDescriptors, java.util.Map 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.ClassDescriptorgetDescriptorForTarget(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Return a descriptor for the target of this mappingjava.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField>getForeignKeyFields()INTERNAL: Returns the foreign key names associated with the mapping.protected java.lang.ObjectgetPrimaryKeyForObject(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL:java.lang.ObjectgetRealAttributeValueFromAttribute(java.lang.Object attributeValue, java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Object reference must unwrap the reference object if required.booleanhasConstraintDependency()INTERNAL: The returns if the mapping has any constraint dependencies, such as foreign keys and join tables.booleanhasRelationTableMechanism()PUBLIC: Indicates whether the mapping has RelationTableMechanism.protected voidinsert(WriteObjectQuery query)INTERNAL: Insert privately owned partsorg.eclipse.persistence.internal.sessions.ObjectReferenceChangeRecordinternalBuildChangeRecord(java.lang.Object newValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Directly build a change record based on the newValue without comparisonbooleanisChangeTrackingSupported(Project project)INTERNAL: Return if this mapping supports change tracking.booleanisForeignKeyRelationship()INTERNAL: Return if the 1-1 mapping has a foreign key dependency to its target.booleanisObjectReferenceMapping()INTERNAL: Related mapping should implement this method to return true.voiditerateOnRealAttributeValue(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, java.lang.Object realAttributeValue)INTERNAL: Iterate on the attribute value.voidloadAll(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.helper.IdentityHashSet loaded)Force instantiation of all indirections.voidmergeChangesIntoObject(java.lang.Object target, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: Merge changes from the source to the target object.voidmergeIntoObject(java.lang.Object target, boolean isTargetUnInitialized, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: Merge changes from the source to the target object.voidpostCalculateChanges(ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.voidpostDelete(DeleteObjectQuery query)INTERNAL: Delete privately owned partsvoidpostInsert(WriteObjectQuery query)INTERNAL: Insert privately owned partsvoidpostUpdate(WriteObjectQuery query)INTERNAL: Update privately owned partsvoidpreDelete(DeleteObjectQuery query)INTERNAL: Delete privately owned partsvoidpreInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Initialize the state of mapping.voidpreInsert(WriteObjectQuery query)INTERNAL: Insert privately owned partsvoidpreUpdate(WriteObjectQuery query)INTERNAL: Update privately owned partsprotected java.lang.ObjectreadPrivateOwnedForObject(ObjectLevelModifyQuery modifyQuery)INTERNAL: Reads the private owned object.voidrecordPrivateOwnedRemovals(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.protected voidsetForeignKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> foreignKeyFields)INTERNAL: Set the foreign key fields associated with the mapping.voidsetIsForeignKeyRelationship(boolean isForeignKeyRelationship)INTERNAL: Set if the 1-1 mapping has a foreign key dependency to its target.voidsetNewValueInChangeRecord(java.lang.Object newValue, org.eclipse.persistence.internal.sessions.ObjectReferenceChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Set the newValue in the change recordprotected voidupdate(WriteObjectQuery query)INTERNAL: Update the private owned part.voidupdateChangeRecord(java.lang.Object clone, java.lang.Object newValue, java.lang.Object oldValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)INTERNAL: Either create a new change record or update the change record with the new value.voidupdateChangeRecordForSelfMerge(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, java.lang.Object source, java.lang.Object target, org.eclipse.persistence.internal.sessions.UnitOfWorkChangeSet parentUOWChangeSet, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)INTERNAL: Update a ChangeRecord to replace the ChangeSet for the old entity with the changeSet for the new Entity.voiduseProxyIndirection()PUBLIC: Set this mapping to use Proxy Indirection.voiduseProxyIndirection(java.lang.Class targetInterface)PUBLIC: Set this mapping to use Proxy Indirection.voiduseProxyIndirection(java.lang.Class[] targetInterfaces)PUBLIC: Set this mapping to use Proxy Indirection.java.lang.ObjectvalueFromPKList(java.lang.Object[] pks, org.eclipse.persistence.internal.sessions.AbstractRecord foreignKeys, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: This method is used to load a relationship from a list of PKs.booleanverifyDelete(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: To verify if the specified object is deleted or not.voidwriteFromObjectIntoRowForUpdate(WriteObjectQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow)INTERNAL: Get a value from the object and set that in the respective field of the row.voidwriteFromObjectIntoRowForWhereClause(ObjectLevelModifyQuery query, org.eclipse.persistence.internal.sessions.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 Detail
-
isForeignKeyRelationship
protected boolean isForeignKeyRelationship
Keeps track if any of the fields are foreign keys.
-
foreignKeyFields
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> foreignKeyFields
Keeps track of which fields are foreign keys on a per field basis (can have mixed foreign key relationships).
-
-
Method Detail
-
buildBackupCloneForPartObject
public java.lang.Object buildBackupCloneForPartObject(java.lang.Object attributeValue, java.lang.Object clone, java.lang.Object backup, org.eclipse.persistence.internal.sessions.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:
buildBackupCloneForPartObjectin classForeignReferenceMapping
-
buildCloneForPartObject
public java.lang.Object buildCloneForPartObject(java.lang.Object attributeValue, java.lang.Object original, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, java.lang.Object clone, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession, java.lang.Integer refreshCascade, boolean isExisting, boolean isFromSharedCache)INTERNAL: Require for cloning, the part must be cloned. Ignore the objects, use the attribute value.- Specified by:
buildCloneForPartObjectin classForeignReferenceMapping
-
buildUnitofWorkCloneForPartObject
public java.lang.Object buildUnitofWorkCloneForPartObject(java.lang.Object attributeValue, java.lang.Object original, java.lang.Object clone, java.lang.Integer refreshCascade, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, boolean isExisting)INTERNAL: Require for cloning, the part must be cloned. Ignore the objects, use the attribute value.
-
buildCopy
public void buildCopy(java.lang.Object copy, java.lang.Object original, CopyGroup group)INTERNAL: Copy of the attribute of the object. This is NOT used for unit of work but for templatizing an object.- Overrides:
buildCopyin classDatabaseMapping
-
buildExpression
public Expression buildExpression(java.lang.Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, java.util.Map processedObjects, org.eclipse.persistence.internal.sessions.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:
buildExpressionin classDatabaseMapping
-
compareForChange
public org.eclipse.persistence.internal.sessions.ChangeRecord compareForChange(java.lang.Object clone, java.lang.Object backUp, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Return an ObjectReferenceChangeRecord describing the change, or null if no change. Used to compute changes for deferred change tracking.- Specified by:
compareForChangein classDatabaseMapping- Returns:
- prototype.changeset.ChangeRecord
-
internalBuildChangeRecord
public org.eclipse.persistence.internal.sessions.ObjectReferenceChangeRecord internalBuildChangeRecord(java.lang.Object newValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Directly build a change record based on the newValue without comparison
-
setNewValueInChangeRecord
public void setNewValueInChangeRecord(java.lang.Object newValue, org.eclipse.persistence.internal.sessions.ObjectReferenceChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Set the newValue in the change record
-
compareObjectsWithoutPrivateOwned
protected boolean compareObjectsWithoutPrivateOwned(java.lang.Object firstObject, java.lang.Object secondObject, org.eclipse.persistence.internal.sessions.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:
compareObjectsWithoutPrivateOwnedin classForeignReferenceMapping
-
compareObjectsWithPrivateOwned
protected boolean compareObjectsWithPrivateOwned(java.lang.Object firstObject, java.lang.Object secondObject, org.eclipse.persistence.internal.sessions.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:
compareObjectsWithPrivateOwnedin classForeignReferenceMapping
-
fixRealObjectReferences
public void fixRealObjectReferences(java.lang.Object object, java.util.Map objectDescriptors, java.util.Map 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:
fixRealObjectReferencesin classDatabaseMapping
-
getDescriptorForTarget
public ClassDescriptor getDescriptorForTarget(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Return a descriptor for the target of this mapping- See Also:
Bug 2612571
-
getRealAttributeValueFromAttribute
public java.lang.Object getRealAttributeValueFromAttribute(java.lang.Object attributeValue, java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Object reference must unwrap the reference object if required.- Overrides:
getRealAttributeValueFromAttributein classForeignReferenceMapping
-
isObjectReferenceMapping
public boolean isObjectReferenceMapping()
INTERNAL: Related mapping should implement this method to return true.- Overrides:
isObjectReferenceMappingin classDatabaseMapping
-
iterateOnRealAttributeValue
public void iterateOnRealAttributeValue(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, java.lang.Object realAttributeValue)INTERNAL: Iterate on the attribute value. The value holder has already been processed.- Specified by:
iterateOnRealAttributeValuein classForeignReferenceMapping
-
loadAll
public void loadAll(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.helper.IdentityHashSet loaded)Force instantiation of all indirections.- Overrides:
loadAllin classDatabaseMapping
-
mergeChangesIntoObject
public void mergeChangesIntoObject(java.lang.Object target, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: Merge changes from the source to the target object. Which is the original from the parent UnitOfWork- Specified by:
mergeChangesIntoObjectin classDatabaseMapping
-
mergeIntoObject
public void mergeIntoObject(java.lang.Object target, boolean isTargetUnInitialized, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: Merge changes from the source to the target object.- Specified by:
mergeIntoObjectin classDatabaseMapping
-
collectFields
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> collectFields()
INTERNAL: Return all the fields populated by this mapping, these are foreign keys only.- Overrides:
collectFieldsin classDatabaseMapping
-
getForeignKeyFields
public java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> 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
protected void setForeignKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> foreignKeyFields)
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
public void preInsert(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
INTERNAL: Insert privately owned parts- Overrides:
preInsertin classDatabaseMapping- Throws:
DatabaseExceptionOptimisticLockException
-
readPrivateOwnedForObject
protected java.lang.Object readPrivateOwnedForObject(ObjectLevelModifyQuery modifyQuery) throws DatabaseException
INTERNAL: Reads the private owned object.- Throws:
DatabaseException
-
preUpdate
public void preUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
INTERNAL: Update privately owned parts- Overrides:
preUpdatein classDatabaseMapping- Throws:
DatabaseExceptionOptimisticLockException
-
postCalculateChanges
public void postCalculateChanges(ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.- Overrides:
postCalculateChangesin classDatabaseMapping
-
recordPrivateOwnedRemovals
public void recordPrivateOwnedRemovals(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.- Overrides:
recordPrivateOwnedRemovalsin classDatabaseMapping
-
postDelete
public void postDelete(DeleteObjectQuery query) throws DatabaseException, OptimisticLockException
INTERNAL: Delete privately owned parts- Overrides:
postDeletein classDatabaseMapping- Throws:
DatabaseExceptionOptimisticLockException
-
postInsert
public void postInsert(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
INTERNAL: Insert privately owned parts- Overrides:
postInsertin classDatabaseMapping- Throws:
DatabaseExceptionOptimisticLockException
-
postUpdate
public void postUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
INTERNAL: Update privately owned parts- Overrides:
postUpdatein classDatabaseMapping- Throws:
DatabaseExceptionOptimisticLockException
-
preDelete
public void preDelete(DeleteObjectQuery query) throws DatabaseException, OptimisticLockException
INTERNAL: Delete privately owned parts- Overrides:
preDeletein classDatabaseMapping- Throws:
DatabaseExceptionOptimisticLockException
-
earlyPreDelete
public void earlyPreDelete(DeleteObjectQuery query, java.lang.Object object)
INTERNAL: Record deletion dependencies for foreign key constraints. This is used during deletion to resolve deletion cycles.- Overrides:
earlyPreDeletein classDatabaseMapping
-
cascadePerformRemoveIfRequired
public void cascadePerformRemoveIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)INTERNAL: Cascade registerNew for Create through mappings that require the cascade- Specified by:
cascadePerformRemoveIfRequiredin classDatabaseMapping
-
cascadePerformRemoveIfRequired
public void cascadePerformRemoveIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.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(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)INTERNAL: Cascade removal of orphaned private owned objects from the UnitOfWorkChangeSet- Overrides:
cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequiredin classDatabaseMapping
-
collectQueryParameters
public 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- Specified by:
collectQueryParametersin classForeignReferenceMapping
-
cascadeDiscoverAndPersistUnregisteredNewObjects
public void cascadeDiscoverAndPersistUnregisteredNewObjects(java.lang.Object object, java.util.Map newObjects, java.util.Map unregisteredExistingObjects, java.util.Map visitedObjects, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Set cascadeErrors)INTERNAL: Cascade discover and persist new objects during commit.- Overrides:
cascadeDiscoverAndPersistUnregisteredNewObjectsin classDatabaseMapping
-
cascadeDiscoverAndPersistUnregisteredNewObjects
public void cascadeDiscoverAndPersistUnregisteredNewObjects(java.lang.Object object, java.util.Map newObjects, java.util.Map unregisteredExistingObjects, java.util.Map visitedObjects, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, boolean getAttributeValueFromObject, java.util.Set cascadeErrors)INTERNAL: Cascade discover and persist new objects during commit.
-
cascadeRegisterNewIfRequired
public void cascadeRegisterNewIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)INTERNAL: Cascade registerNew for Create through mappings that require the cascade- Specified by:
cascadeRegisterNewIfRequiredin classDatabaseMapping
-
cascadeRegisterNewIfRequired
public void cascadeRegisterNewIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.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
protected java.lang.Object getPrimaryKeyForObject(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL:
-
hasConstraintDependency
public boolean hasConstraintDependency()
INTERNAL: The returns if the mapping has any constraint dependencies, such as foreign keys and join tables.- Overrides:
hasConstraintDependencyin classDatabaseMapping
-
createCloneValueHolder
public org.eclipse.persistence.internal.indirection.DatabaseValueHolder createCloneValueHolder(ValueHolderInterface attributeValue, java.lang.Object original, java.lang.Object clone, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession, boolean buildDirectlyFromRow)
INTERNAL: Builder the unit of work value holder.- Overrides:
createCloneValueHolderin classForeignReferenceMapping- Parameters:
buildDirectlyFromRow- 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.
-
extractPrimaryKeyRowForSourceObject
public org.eclipse.persistence.internal.sessions.AbstractRecord extractPrimaryKeyRowForSourceObject(java.lang.Object domainObject, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Extract the reference pk for rvh usage in remote model.
-
extractPrimaryKeysForReferenceObject
public java.lang.Object extractPrimaryKeysForReferenceObject(java.lang.Object domainObject, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Extract the reference pk for rvh usage in remote model.
-
extractPrimaryKeysForReferenceObjectFromRow
public java.lang.Object extractPrimaryKeysForReferenceObjectFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row)
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
public java.lang.Object extractPrimaryKeysFromRealReferenceObject(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Extract the reference pk for rvh usage in remote model.
-
preInitialize
public void preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorExceptionINTERNAL: Initialize the state of mapping.- Overrides:
preInitializein classForeignReferenceMapping- Throws:
DescriptorException
-
insert
protected void insert(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
INTERNAL: Insert privately owned parts
-
update
protected void update(WriteObjectQuery query) throws DatabaseException, OptimisticLockException
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 theProxyandInvocationHandlerfeatures 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
toStringis 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
public java.lang.Object[] buildReferencesPKList(java.lang.Object entity, java.lang.Object attribute, org.eclipse.persistence.internal.sessions.AbstractSession session)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:
buildReferencesPKListin classForeignReferenceMapping- See Also:
ContainerPolicy.buildReferencesPKList(java.lang.Object, org.eclipse.persistence.internal.sessions.AbstractSession),MappedKeyMapContainerPolicy
-
buildTargetInterfaces
public java.util.Collection buildTargetInterfaces(java.lang.Class aClass, java.util.Collection targetInterfacesCol)INTERNAL: Build a list of all the interfaces and super interfaces for a given class.
-
useProxyIndirection
public void useProxyIndirection(java.lang.Class[] targetInterfaces)
PUBLIC: Set this mapping to use Proxy Indirection. Proxy Indirection uses theProxyandInvocationHandlerfeatures 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
toStringis 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 void useProxyIndirection(java.lang.Class targetInterface)
PUBLIC: Set this mapping to use Proxy Indirection. Proxy Indirection uses theProxyandInvocationHandlerfeatures 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
toStringis 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
public java.lang.Object valueFromPKList(java.lang.Object[] pks, org.eclipse.persistence.internal.sessions.AbstractRecord foreignKeys, org.eclipse.persistence.internal.sessions.AbstractSession session)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:
valueFromPKListin classForeignReferenceMapping
-
verifyDelete
public boolean verifyDelete(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseExceptionINTERNAL: To verify if the specified object is deleted or not.- Overrides:
verifyDeletein classDatabaseMapping- Throws:
DatabaseException
-
writeFromObjectIntoRowForUpdate
public void writeFromObjectIntoRowForUpdate(WriteObjectQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow)
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:
writeFromObjectIntoRowForUpdatein classDatabaseMapping
-
writeFromObjectIntoRowForWhereClause
public void writeFromObjectIntoRowForWhereClause(ObjectLevelModifyQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow)
INTERNAL: Get a value from the object and set that in the respective field of the row.- Overrides:
writeFromObjectIntoRowForWhereClausein classDatabaseMapping
-
isChangeTrackingSupported
public boolean isChangeTrackingSupported(Project project)
INTERNAL: Return if this mapping supports change tracking.- Overrides:
isChangeTrackingSupportedin classDatabaseMapping
-
updateChangeRecord
public void updateChangeRecord(java.lang.Object clone, java.lang.Object newValue, java.lang.Object oldValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet, org.eclipse.persistence.internal.sessions.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:
updateChangeRecordin classDatabaseMapping
-
updateChangeRecordForSelfMerge
public void updateChangeRecordForSelfMerge(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, java.lang.Object source, java.lang.Object target, org.eclipse.persistence.internal.sessions.UnitOfWorkChangeSet parentUOWChangeSet, org.eclipse.persistence.internal.sessions.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:
updateChangeRecordForSelfMergein classForeignReferenceMapping
-
buildChangeRecord
public org.eclipse.persistence.internal.sessions.ChangeRecord buildChangeRecord(java.lang.Object clone, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Directly build a change record without comparison- Overrides:
buildChangeRecordin classDatabaseMapping
-
-