public class XMLObjectReferenceMapping extends AggregateMapping implements XMLMapping
DatabaseMapping.WriteType| Constructor and Description |
|---|
XMLObjectReferenceMapping()
PUBLIC:
The default constructor initializes the sourceToTargetKeyFieldAssociations
and sourceToTargetKeys data structures.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSourceToTargetKeyFieldAssociation(String srcXPath,
String tgtXPath)
PUBLIC:
Add a source-target xpath pair to the map.
|
Object |
buildFieldValue(Object targetObject,
XMLField xmlFld,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Retrieve the target object's primary key value that is mapped to a given
source xpath (in the source-target key field association list).
|
void |
buildReference(UnmarshalRecord record,
XMLField xmlField,
Object object,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Create (if necessary) and populate a reference object that will be used
during the mapping reference resolution phase after unmarshalling is
complete.
|
void |
cascadePerformRemoveIfRequired(Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
Map visitedObjects)
INTERNAL:
Cascade perform delete 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
|
Vector |
getFields()
INTERNAL:
Return a list of XMLFields based on the source XPath values
in the source-target key field associations list.
|
XMLInverseReferenceMapping |
getInverseReferenceMapping() |
HashMap |
getSourceToTargetKeyFieldAssociations()
INTERNAL:
Return a list of source-target xmlfield pairs.
|
void |
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Register a ReferenceResolver as an event listener on the session,
if one doesn't already exist.
|
boolean |
isWriteOnly()
INTERNAL:
Some mappings support no attribute (transformation).
|
boolean |
isXMLMapping()
INTERNAL:
Indicates that this is an XML mapping.
|
void |
preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Allow for initialization of properties and validation.
|
Object |
readFromRowIntoObject(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
Object targetObject,
ObjectBuildingQuery sourceQuery,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
INTERNAL:
Extract the primary key values from the row, then create an
org.eclipse.persistence.internal.oxm.Reference instance and store it
on the session's org.eclipse.persistence.internal.oxm.ReferenceResolver.
|
void |
setAttributeValueInObject(Object object,
Object value)
INTERNAL:
Set the value of the attribute mapped by this mapping.
|
void |
setField(org.eclipse.persistence.internal.helper.DatabaseField field) |
void |
setIsWriteOnly(boolean b) |
void |
setSourceToTargetKeyFieldAssociations(HashMap sourceToTargetKeyFieldAssociations)
INTERNAL:
Set the list of source-target xmlfield pairs.
|
void |
writeFromObjectIntoRow(Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session,
DatabaseMapping.WriteType writeType)
INTERNAL:
Write the attribute value from the object to the row.
|
void |
writeSingleValue(Object value,
Object parent,
XMLRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
A method that marshals a single value to the provided Record based on this mapping's
XPath.
|
buildBackupClone, buildClone, buildCloneFromRow, buildCopy, buildExpression, compareForChange, compareObjects, convertClassNamesToClasses, fixObjectReferences, getReferenceClass, getReferenceClassName, getReferenceDescriptor, isAggregateMapping, iterate, mergeChangesIntoObject, mergeIntoObject, 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, getContainerPolicy, getDerivedIdMapping, getDescriptor, getField, getFieldClassification, 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, iterateOnRealAttributeValue, performDataModificationEvent, postCalculateChanges, postCalculateChangesOnDeleted, postInitialize, prepareCascadeLockingPolicy, readFromResultSetIntoObject, readOnly, readWrite, recordPrivateOwnedRemovals, rehashFieldDependancies, replaceValueHoldersIn, setAttributeAccessor, setAttributeName, 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, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowForWhereClause, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow, writeUpdateFieldsIntoRowpublic XMLObjectReferenceMapping()
public void addSourceToTargetKeyFieldAssociation(String srcXPath, String tgtXPath)
srcXPath - tgtXPath - public Object buildFieldValue(Object targetObject, XMLField xmlFld, org.eclipse.persistence.internal.sessions.AbstractSession session)
sourceObject - xmlFld - session - public void buildReference(UnmarshalRecord record, XMLField xmlField, Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)
record - xmlField - object - session - public void cascadePerformRemoveIfRequired(Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, Map visitedObjects)
cascadePerformRemoveIfRequired in class DatabaseMappingpublic void cascadeRegisterNewIfRequired(Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, Map visitedObjects)
cascadeRegisterNewIfRequired in class DatabaseMappingpublic Vector getFields()
getFields in class DatabaseMappingpublic HashMap getSourceToTargetKeyFieldAssociations()
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DescriptorException
initialize in class AggregateMappingDescriptorExceptionReferenceResolver,
NamespaceResolverpublic void preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DescriptorException
DatabaseMappingpreInitialize in class DatabaseMappingDescriptorExceptionpublic boolean isXMLMapping()
isXMLMapping in class DatabaseMappingpublic Object readFromRowIntoObject(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, Object targetObject, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.AbstractSession executionSession) throws DatabaseException
readFromRowIntoObject in class DatabaseMappingDatabaseExceptionpublic void setField(org.eclipse.persistence.internal.helper.DatabaseField field)
field - public void setSourceToTargetKeyFieldAssociations(HashMap sourceToTargetKeyFieldAssociations)
public void writeFromObjectIntoRow(Object object, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType)
writeFromObjectIntoRow in class DatabaseMappingpublic void writeSingleValue(Object value, Object parent, XMLRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
XMLMappingwriteSingleValue in interface XMLMappingvalue - - The value to be marshalledrow - - The Record the value is being marshalled too.public void setIsWriteOnly(boolean b)
setIsWriteOnly in interface XMLMappingpublic boolean isWriteOnly()
DatabaseMappingisWriteOnly in interface XMLMappingisWriteOnly in class DatabaseMappingpublic void setAttributeValueInObject(Object object, Object value) throws DescriptorException
DatabaseMappingsetAttributeValueInObject in class DatabaseMappingDescriptorExceptionpublic XMLInverseReferenceMapping getInverseReferenceMapping()