public class XMLObjectReferenceMapping extends AggregateMapping implements org.eclipse.persistence.internal.oxm.mappings.ObjectReferenceMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.oxm.record.UnmarshalRecord,XMLField,XMLRecord>, XMLMapping
DatabaseMapping.WriteType| Modifier and Type | Field and Description |
|---|---|
protected java.util.HashMap |
sourceToTargetKeyFieldAssociations |
protected java.util.Vector |
sourceToTargetKeys |
hasNestedIdentityReference, referenceClass, referenceClassName, referenceDescriptorattributeAccessor, attributeName, derivedIdMapping, derivesId, descriptor, fields, isCacheable, isInSopObject, isJPAId, isLazy, isMapKeyMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, mapsIdValue, NO_FIELDS, NO_WEIGHT, properties, unconvertedProperties, weight, WEIGHT_AGGREGATE, WEIGHT_DIRECT, WEIGHT_TO_ONE, WEIGHT_TRANSFORM| Constructor and Description |
|---|
XMLObjectReferenceMapping()
PUBLIC:
The default constructor initializes the sourceToTargetKeyFieldAssociations
and sourceToTargetKeys data structures.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSourceToTargetKeyFieldAssociation(java.lang.String srcXPath,
java.lang.String tgtXPath)
PUBLIC:
Add a source-target xpath pair to the map.
|
void |
addSourceToTargetKeyFieldAssociation(XMLField srcField,
XMLField tgtField) |
java.lang.Object |
buildFieldValue(java.lang.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(org.eclipse.persistence.internal.oxm.record.UnmarshalRecord record,
XMLField xmlField,
java.lang.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(java.lang.Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
java.util.Map visitedObjects)
INTERNAL:
Cascade perform delete through mappings that require the cascade
|
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
|
java.util.Vector |
getFields()
INTERNAL:
Return a list of XMLFields based on the source XPath values
in the source-target key field associations list.
|
XMLInverseReferenceMapping |
getInverseReferenceMapping() |
protected javax.xml.namespace.QName |
getSchemaType(XMLField xmlField,
java.lang.Object value,
org.eclipse.persistence.internal.sessions.AbstractSession session)
Return a QName representation the schema type for a given XMLField, if
applicable.
|
protected javax.xml.namespace.QName |
getSingleValueToWriteForUnion(XMLUnionField xmlField,
java.lang.Object value,
org.eclipse.persistence.internal.sessions.AbstractSession session)
Return a single QName representation for a given XMLUnionField, if applicable.
|
java.util.HashMap |
getSourceToTargetKeyFieldAssociations()
INTERNAL:
Return a list of source-target xmlfield pairs.
|
protected java.lang.String |
getValueToWrite(javax.xml.namespace.QName schemaType,
java.lang.Object value,
org.eclipse.persistence.internal.sessions.AbstractSession session)
Return a string representation of a given value, based on a given schema type.
|
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 |
isObjectReferenceMapping()
INTERNAL:
Related mapping should implement this method to return true.
|
boolean |
isWriteOnly()
INTERNAL:
Some mappings support no attribute (transformation and multitenant primary key).
|
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.
|
java.lang.Object |
readFromRowIntoObject(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
java.lang.Object targetObject,
org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey,
ObjectBuildingQuery sourceQuery,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession,
boolean isTargetProtected)
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(java.lang.Object object,
java.lang.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(java.util.HashMap sourceToTargetKeyFieldAssociations)
INTERNAL:
Set the list of source-target xmlfield pairs.
|
void |
writeFromObjectIntoRow(java.lang.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(java.lang.Object value,
java.lang.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.
|
buildAggregateDeleteQuery, buildAggregateModifyQuery, buildAggregateWriteQuery, buildBackupClone, buildBackupClonePart, buildClone, buildCloneFromRow, buildClonePart, buildClonePart, buildCopy, buildCopyOfAttributeValue, buildExpression, buildNewMergeInstanceOf, compareAttributeValues, compareForChange, compareObjects, convertClassNamesToClasses, executeEvent, fixAttributeValue, fixObjectReferences, getAttributeValueFromBackupClone, getObjectBuilder, getObjectBuilderForClass, getQueryManager, getReferenceClass, getReferenceClassName, getReferenceDescriptor, getReferenceDescriptor, getReferenceDescriptor, hasNestedIdentityReference, isAggregateMapping, iterate, iterateOnAttributeValue, load, loadAll, mergeAttributeValue, mergeChangesIntoObject, mergeIntoObject, postDelete, postDeleteAttributeValue, postInsert, postInsertAttributeValue, postUpdate, postUpdateAttributeValue, preDelete, preDeleteAttributeValue, preInsert, preInsertAttributeValue, preUpdate, preUpdateAttributeValue, remoteInitialization, setReferenceClass, setReferenceClassName, setReferenceDescriptor, updateChangeRecord, verifyDelete, verifyDeleteOfAttributeValueaddUnconvertedProperty, buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildContainerClone, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, clone, cloneFields, collectFields, collectQueryParameters, convertConverterClassNamesToClasses, createCloneValueHolder, derivesId, earlyPreDelete, extractNestedExpressions, fixRealObjectReferences, getAttributeAccessor, getAttributeClassification, getAttributeName, getAttributeValueFromObject, getContainerPolicy, getDerivedIdMapping, getDescriptor, getField, getFieldClassification, getGetMethodName, getMapsIdValue, getObjectCorrespondingTo, getOrderByNormalizedExpressions, getProperties, getProperty, getRealAttributeValueFromAttribute, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, getRelationshipPartner, getSelectFields, getSelectTables, getSetMethodName, getUnconvertedProperties, getValueFromRemoteValueHolder, getWeight, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, hasMapsIdValue, hasRootExpressionThatShouldUseOuterJoin, hasUnconvertedProperties, instantiateAttribute, isAbstractColumnMapping, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateObjectMapping, isAttributeValueFromObjectInstantiated, isCacheable, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isChangeTrackingSupported, isCloningRequired, isCollectionMapping, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isElementCollectionMapping, isForeignReferenceMapping, isInAndOutSopObject, isInOnlySopObject, isInSopObject, isJoiningSupported, isJPAId, isLazy, isLockableMapping, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isMultitenantPrimaryKeyMapping, isNestedTableMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOutOnlySopObject, isOutSopObject, isOwned, isPrimaryKeyMapping, isPrivateOwned, isReadOnly, isReferenceMapping, isRelationalMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, iterateOnRealAttributeValue, performDataModificationEvent, postCalculateChanges, postCalculateChangesOnDeleted, postInitialize, prepareCascadeLockingPolicy, readFromResultSetIntoObject, readOnly, readWrite, recordPrivateOwnedRemovals, rehashFieldDependancies, remotelyInitialized, replaceValueHoldersIn, setAttributeAccessor, setAttributeName, setChangeListener, setDerivedIdMapping, setDerivesId, setDescriptor, setFields, setGetMethodName, setIsCacheable, setIsInAndOutSopObject, setIsInSopObject, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsOutSopObject, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setRealAttributeValueInObject, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, toString, updateCollectionChangeRecord, validateAfterInitialization, validateBeforeInitialization, valueFromObject, valueFromResultSet, valueFromRow, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowForUpdateAfterShallowInsert, writeFromObjectIntoRowForUpdateBeforeShallowDelete, writeFromObjectIntoRowForWhereClause, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow, writeUpdateFieldsIntoRowequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetReferenceClass, getReferenceClassName, setReferenceClassNameconvertClassNamesToClassesgetAttributeAccessor, getAttributeClassification, getAttributeName, getAttributeValueFromObject, getContainerPolicy, getDescriptor, getField, getReferenceDescriptor, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isCollectionMapping, isReadOnly, isReferenceMapping, isTransformationMapping, setAttributeAccessor, setAttributeName, setGetMethodName, setIsReadOnly, setProperties, setSetMethodNameprotected java.util.HashMap sourceToTargetKeyFieldAssociations
protected java.util.Vector sourceToTargetKeys
public XMLObjectReferenceMapping()
public void addSourceToTargetKeyFieldAssociation(java.lang.String srcXPath,
java.lang.String tgtXPath)
addSourceToTargetKeyFieldAssociation in interface org.eclipse.persistence.internal.oxm.mappings.ObjectReferenceMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.oxm.record.UnmarshalRecord,XMLField,XMLRecord>srcXPath - tgtXPath - public void addSourceToTargetKeyFieldAssociation(XMLField srcField, XMLField tgtField)
public java.lang.Object buildFieldValue(java.lang.Object targetObject,
XMLField xmlFld,
org.eclipse.persistence.internal.sessions.AbstractSession session)
buildFieldValue in interface org.eclipse.persistence.internal.oxm.mappings.ObjectReferenceMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.oxm.record.UnmarshalRecord,XMLField,XMLRecord>sourceObject - xmlFld - session - public void buildReference(org.eclipse.persistence.internal.oxm.record.UnmarshalRecord record,
XMLField xmlField,
java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractSession session)
buildReference in interface org.eclipse.persistence.internal.oxm.mappings.ObjectReferenceMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.oxm.record.UnmarshalRecord,XMLField,XMLRecord>record - xmlField - object - session - public void cascadePerformRemoveIfRequired(java.lang.Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
java.util.Map visitedObjects)
cascadePerformRemoveIfRequired in class DatabaseMappingpublic void cascadeRegisterNewIfRequired(java.lang.Object object,
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow,
java.util.Map visitedObjects)
cascadeRegisterNewIfRequired in class DatabaseMappingpublic java.util.Vector getFields()
getFields in interface org.eclipse.persistence.internal.oxm.mappings.ObjectReferenceMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.oxm.record.UnmarshalRecord,XMLField,XMLRecord>getFields in class DatabaseMappingprotected javax.xml.namespace.QName getSchemaType(XMLField xmlField, java.lang.Object value, org.eclipse.persistence.internal.sessions.AbstractSession session)
xmlField - value - protected javax.xml.namespace.QName getSingleValueToWriteForUnion(XMLUnionField xmlField, java.lang.Object value, org.eclipse.persistence.internal.sessions.AbstractSession session)
xmlField - value - public java.util.HashMap getSourceToTargetKeyFieldAssociations()
getSourceToTargetKeyFieldAssociations in interface org.eclipse.persistence.internal.oxm.mappings.ObjectReferenceMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.oxm.record.UnmarshalRecord,XMLField,XMLRecord>protected java.lang.String getValueToWrite(javax.xml.namespace.QName schemaType,
java.lang.Object value,
org.eclipse.persistence.internal.sessions.AbstractSession session)
schemaType - value - 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 java.lang.Object readFromRowIntoObject(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
java.lang.Object targetObject,
org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey,
ObjectBuildingQuery sourceQuery,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession,
boolean isTargetProtected)
throws DatabaseException
readFromRowIntoObject in class DatabaseMappingDatabaseExceptionpublic void setField(org.eclipse.persistence.internal.helper.DatabaseField field)
field - public void setSourceToTargetKeyFieldAssociations(java.util.HashMap sourceToTargetKeyFieldAssociations)
public void writeFromObjectIntoRow(java.lang.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(java.lang.Object value,
java.lang.Object parent,
XMLRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session)
XMLMappingwriteSingleValue in interface org.eclipse.persistence.internal.oxm.mappings.Mapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLRecord>writeSingleValue in interface XMLMappingvalue - - The value to be marshalledrow - - The Record the value is being marshalled too.public void setIsWriteOnly(boolean b)
setIsWriteOnly in interface org.eclipse.persistence.internal.oxm.mappings.ObjectReferenceMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.oxm.record.UnmarshalRecord,XMLField,XMLRecord>setIsWriteOnly in interface XMLMappingpublic boolean isWriteOnly()
DatabaseMappingisWriteOnly in interface org.eclipse.persistence.internal.oxm.mappings.ObjectReferenceMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.oxm.record.UnmarshalRecord,XMLField,XMLRecord>isWriteOnly in interface XMLMappingisWriteOnly in class DatabaseMappingpublic void setAttributeValueInObject(java.lang.Object object,
java.lang.Object value)
throws DescriptorException
DatabaseMappingsetAttributeValueInObject in interface org.eclipse.persistence.internal.oxm.mappings.Mapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,XMLRecord>setAttributeValueInObject in class DatabaseMappingDescriptorExceptionpublic XMLInverseReferenceMapping getInverseReferenceMapping()
getInverseReferenceMapping in interface org.eclipse.persistence.internal.oxm.mappings.ObjectReferenceMapping<org.eclipse.persistence.internal.sessions.AbstractSession,AttributeAccessor,org.eclipse.persistence.internal.queries.ContainerPolicy,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField,org.eclipse.persistence.internal.oxm.record.UnmarshalRecord,XMLField,XMLRecord>public boolean isObjectReferenceMapping()
DatabaseMappingisObjectReferenceMapping in class DatabaseMapping