public class XMLCollectionReferenceMapping extends XMLObjectReferenceMapping implements ContainerMapping
DatabaseMapping.WriteType| Constructor and Description |
|---|
XMLCollectionReferenceMapping()
PUBLIC:
The default constructor initializes the sourceToTargetKeyFieldAssociations
and sourceToTargetKeys data structures.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
org.eclipse.persistence.internal.queries.ContainerPolicy |
getContainerPolicy()
INTERNAL:
Return the mapping's containerPolicy.
|
org.eclipse.persistence.internal.helper.DatabaseField |
getField()
INTERNAL:
Return the field associated with this mapping if there is exactly one.
|
boolean |
getReuseContainer()
Return true if the original container on the object should be used if
present.
|
String |
getXPath()
Get the XPath String
|
void |
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
The mapping is initialized with the given session.
|
boolean |
isCollectionMapping()
INTERNAL:
Related mapping should implement this method to return true.
|
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 stored it
on the session's org.eclipse.persistence.internal.oxm.ReferenceResolver.
|
void |
setContainerPolicy(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
ADVANCED:
Set the mapping's containerPolicy.
|
void |
setField(org.eclipse.persistence.internal.helper.DatabaseField field) |
void |
setReuseContainer(boolean reuseContainer)
Specify whether the original container on the object should be used if
present.
|
void |
setUsesSingleNode(boolean useSingleNode) |
void |
setXPath(String xpathString)
Set the Mapping field name attribute to the given XPath String
|
void |
useCollectionClass(Class concreteContainerClass)
PUBLIC:
Configure the mapping to use an instance of the specified container class
to hold the target objects.
|
void |
useCollectionClassName(String concreteContainerClassName) |
void |
useMapClass(Class concreteContainerClass,
String methodName)
PUBLIC:
Configure the mapping to use an instance of the specified container class
to hold the target objects.
|
boolean |
usesSingleNode()
INTERNAL:
For the purpose of XMLCollectionReferenceMappings, 'usesSingleNode'
refers to the fact that the source key xpath fields should all be written as
space-separated lists.
|
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.
|
addSourceToTargetKeyFieldAssociation, cascadePerformRemoveIfRequired, cascadeRegisterNewIfRequired, getFields, getInverseReferenceMapping, getSourceToTargetKeyFieldAssociations, isWriteOnly, isXMLMapping, preInitialize, setAttributeValueInObject, setIsWriteOnly, setSourceToTargetKeyFieldAssociationsbuildBackupClone, 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, getDerivedIdMapping, getDescriptor, 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, 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 XMLCollectionReferenceMapping()
public org.eclipse.persistence.internal.helper.DatabaseField getField()
DatabaseMappinggetField in class DatabaseMappingpublic void setField(org.eclipse.persistence.internal.helper.DatabaseField field)
setField in class XMLObjectReferenceMappingpublic String getXPath()
public void setXPath(String xpathString)
xpathString - Stringpublic Object buildFieldValue(Object targetObject, XMLField xmlFld, org.eclipse.persistence.internal.sessions.AbstractSession session)
buildFieldValue in class XMLObjectReferenceMappingtargetObject - - the reference class instance that holds the required pk valuexmlFld - session - public void buildReference(UnmarshalRecord record, XMLField xmlField, Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)
buildReference in class XMLObjectReferenceMappingrecord - xmlField - object - session - public org.eclipse.persistence.internal.queries.ContainerPolicy getContainerPolicy()
getContainerPolicy in interface ContainerMappinggetContainerPolicy in class DatabaseMappingpublic void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
throws DescriptorException
initialize in class XMLObjectReferenceMappingDescriptorExceptionReferenceResolver,
NamespaceResolverpublic 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 XMLObjectReferenceMappingDatabaseExceptionpublic void setContainerPolicy(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
setContainerPolicy in interface ContainerMappingpublic void useCollectionClass(Class concreteContainerClass)
jdk1.2.x: The container class must implement (directly or indirectly) the Collection interface.
jdk1.1.x: The container class must be a subclass of Vector.
useCollectionClass in interface ContainerMappingpublic void useCollectionClassName(String concreteContainerClassName)
public void useMapClass(Class concreteContainerClass, String methodName)
jdk1.2.x: The container class must implement (directly or indirectly) the Map interface.
jdk1.1.x: The container class must be a subclass of Hashtable.
The referenceClass must be set before calling this method.
useMapClass in interface ContainerMappingpublic boolean usesSingleNode()
public void setUsesSingleNode(boolean useSingleNode)
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 XMLObjectReferenceMappingpublic void writeSingleValue(Object value, Object parent, XMLRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
XMLMappingwriteSingleValue in interface XMLMappingwriteSingleValue in class XMLObjectReferenceMappingvalue - - The value to be marshalledrow - - The Record the value is being marshalled too.public boolean isCollectionMapping()
DatabaseMappingisCollectionMapping in class DatabaseMappingpublic boolean getReuseContainer()
public void setReuseContainer(boolean reuseContainer)