public class XMLInverseReferenceMapping extends AggregateMapping implements ContainerMapping
// EMPLOYEE has a collection of PHONEs (phoneNumbers)
// PHONE has a back-pointer to EMPLOYEE (owningEmployee)
// EMPLOYEE Descriptor
XMLCompositeCollectionMapping phone = new XMLCompositeCollectionMapping();
phone.setReferenceClassName("org.example.PhoneNumber");
phone.setAttributeName("phoneNumbers");
...
// PHONE Descriptor
XMLInverseReferenceMapping owningEmployee = new XMLInverseReferenceMapping();
owningEmployee.setReferenceClassName("org.example.Employee");
owningEmployee.setMappedBy("phoneNumbers");
owningEmployee.setAttributeName("owningEmployee");
...
DatabaseMapping.WriteType| Constructor and Description |
|---|
XMLInverseReferenceMapping() |
| Modifier and Type | Method and Description |
|---|---|
void |
buildBackupClone(Object clone,
Object backup,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
INTERNAL:
Clone the attribute from the clone and assign it to the backup.
|
void |
buildClone(Object original,
Object clone,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
INTERNAL:
Clone the attribute from the original and assign it to the clone.
|
void |
buildCloneFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
Object clone,
ObjectBuildingQuery sourceQuery,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
INTERNAL:
A combination of readFromRowIntoObject and buildClone.
|
void |
cascadePerformRemoveIfRequired(Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
Map visitedObjects)
INTERNAL:
Cascade registerNew for Create through mappings that require the cascade
|
void |
cascadeRegisterNewIfRequired(Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
Map visitedObjects)
INTERNAL:
Cascade registerNew for Create through mappings that require the cascade
|
org.eclipse.persistence.internal.sessions.ChangeRecord |
compareForChange(Object clone,
Object backup,
org.eclipse.persistence.internal.sessions.ObjectChangeSet owner,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Compare the changes between two aggregates.
|
boolean |
compareObjects(Object firstObject,
Object secondObject,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Compare the attributes belonging to this mapping for the objects.
|
void |
fixObjectReferences(Object object,
Map objectDescriptors,
Map processedObjects,
ObjectLevelReadQuery query,
RemoteSession session)
INTERNAL:
An object has been serialized from the server to the remote client.
|
org.eclipse.persistence.internal.queries.ContainerPolicy |
getContainerPolicy()
INTERNAL:
Return the mapping's containerPolicy.
|
String |
getMappedBy() |
void |
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Initialize the reference descriptor.
|
boolean |
isXMLMapping()
INTERNAL:
All relational mappings should implement this method to return true.
|
void |
iterate(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator)
INTERNAL:
Iterate on the appropriate attribute value.
|
void |
mergeChangesIntoObject(Object target,
org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord,
Object source,
org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
INTERNAL:
Merge changes from the source to the target object.
|
void |
mergeIntoObject(Object target,
boolean isTargetUninitialized,
Object source,
org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
INTERNAL:
Merge changes from the source to the target object.
|
void |
postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Allow for initialization of properties and validation that have dependecies no the descriptor
being initialized.
|
void |
setContainerPolicy(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
PUBLIC:
Set the mapping's container policy.
|
void |
setMappedBy(String mappedBy) |
void |
useCollectionClass(Class concreteClass)
PUBLIC:
Configure the mapping to use an instance of the specified container class
to hold the target objects.
|
void |
useMapClass(Class concreteClass,
String methodName)
PUBLIC:
Configure the mapping to use an instance of the specified container class
to hold the target objects.
|
buildCopy, buildExpression, convertClassNamesToClasses, getReferenceClass, getReferenceClassName, getReferenceDescriptor, isAggregateMapping, postDelete, postDeleteAttributeValue, postInsert, postInsertAttributeValue, postUpdate, postUpdateAttributeValue, preDelete, preDeleteAttributeValue, preInsert, preInsertAttributeValue, preUpdate, preUpdateAttributeValue, remoteInitialization, setReferenceClass, setReferenceClassName, updateChangeRecord, verifyDeletebuildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadeMerge, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, clone, createUnitOfWorkValueHolder, derivesId, earlyPreDelete, fixRealObjectReferences, getAttributeAccessor, getAttributeClassification, getAttributeName, getAttributeValueFromObject, getDerivedIdMapping, getDescriptor, getField, getFieldClassification, getFields, getGetMethodName, getMapsIdValue, getObjectCorrespondingTo, getProperties, getProperty, getRealAttributeValueFromAttribute, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, getRelationshipPartner, getSelectFields, getSelectTables, getSetMethodName, getValueFromRemoteValueHolder, getWeight, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, hasMapsIdValue, instantiateAttribute, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateObjectMapping, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isChangeTrackingSupported, isCloningRequired, isCollectionMapping, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isForeignReferenceMapping, isJoiningSupported, isJPAId, isLazy, isLockableMapping, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOwned, isPrimaryKeyMapping, isPrivateOwned, isReadOnly, isReferenceMapping, isRelationalMapping, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, iterateOnRealAttributeValue, performDataModificationEvent, postCalculateChanges, postCalculateChangesOnDeleted, preInitialize, prepareCascadeLockingPolicy, readFromResultSetIntoObject, readFromRowIntoObject, readOnly, readWrite, recordPrivateOwnedRemovals, rehashFieldDependancies, replaceValueHoldersIn, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setChangeListener, setDerivedIdMapping, setDerivesId, setDescriptor, setGetMethodName, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setRealAttributeValueInObject, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, toString, updateCollectionChangeRecord, validateAfterInitialization, validateBeforeInitialization, valueFromObject, valueFromResultSet, valueFromRow, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowForWhereClause, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow, writeUpdateFieldsIntoRowpublic boolean isXMLMapping()
DatabaseMappingisXMLMapping in class DatabaseMappingpublic void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DescriptorException
AggregateMappinginitialize in class AggregateMappingDescriptorExceptionpublic void postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DescriptorException
DatabaseMappingpostInitialize in class DatabaseMappingDescriptorExceptionpublic String getMappedBy()
public void setMappedBy(String mappedBy)
public void buildBackupClone(Object clone, Object backup, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
AggregateMappingbuildBackupClone in class AggregateMappingpublic void buildClone(Object original, Object clone, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
AggregateMappingbuildClone in class AggregateMappingpublic void buildCloneFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
Object clone,
ObjectBuildingQuery sourceQuery,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
AggregateMappingbuildClone assumes the attribute value exists on the original and can simply be copied.
readFromRowIntoObject assumes that one is building an original.
Both of the above assumptions are false in this method, and actually attempts to do both at the same time.
Extract value from the row and set the attribute to this value in the working copy clone. In order to bypass the shared cache when in transaction a UnitOfWork must be able to populate working copies directly from the row.
buildCloneFromRow in class AggregateMappingpublic void cascadePerformRemoveIfRequired(Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, Map visitedObjects)
DatabaseMappingcascadePerformRemoveIfRequired in class DatabaseMappingpublic void cascadeRegisterNewIfRequired(Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, Map visitedObjects)
DatabaseMappingcascadeRegisterNewIfRequired in class DatabaseMappingpublic org.eclipse.persistence.internal.sessions.ChangeRecord compareForChange(Object clone, Object backup, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)
AggregateMappingcompareForChange in class AggregateMappingpublic boolean compareObjects(Object firstObject, Object secondObject, org.eclipse.persistence.internal.sessions.AbstractSession session)
AggregateMappingcompareObjects in class AggregateMappingpublic void fixObjectReferences(Object object, Map objectDescriptors, Map processedObjects, ObjectLevelReadQuery query, RemoteSession session)
AggregateMappingfixObjectReferences in class AggregateMappingpublic void iterate(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator)
AggregateMappingiterate in class AggregateMappingpublic void mergeChangesIntoObject(Object target, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
AggregateMappingmergeChangesIntoObject in class AggregateMappingpublic void mergeIntoObject(Object target, boolean isTargetUninitialized, Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager)
AggregateMappingmergeIntoObject in class AggregateMappingpublic void setContainerPolicy(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
ContainerMappingsetContainerPolicy in interface ContainerMappingpublic org.eclipse.persistence.internal.queries.ContainerPolicy getContainerPolicy()
DatabaseMappinggetContainerPolicy in interface ContainerMappinggetContainerPolicy in class DatabaseMappingpublic void useCollectionClass(Class concreteClass)
ContainerMappingThe container class must implement (directly or indirectly) the
java.util.Collection interface.
useCollectionClass in interface ContainerMappingpublic void useMapClass(Class concreteClass, String methodName)
ContainerMappingMap is the value returned by a call to the specified
zero-argument method.
The method must be implemented by the class (or a superclass) of any
value to be inserted into the Map.
The container class must implement (directly or indirectly) the
java.util.Map interface.
To facilitate resolving the method, the mapping's referenceClass must set before calling this method.
useMapClass in interface ContainerMapping