|
EclipseLink1.0 - 20080707 API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.persistence.mappings.DatabaseMapping
org.eclipse.persistence.mappings.AggregateMapping
org.eclipse.persistence.oxm.mappings.XMLObjectReferenceMapping
org.eclipse.persistence.oxm.mappings.XMLCollectionReferenceMapping
public class XMLCollectionReferenceMapping
TopLink OXM version of a 1-M mapping. A list of source-target key field associations is used to link the source xpaths to their related target xpaths, and hence their primary key (unique identifier) values used when (un)marshalling. It is important to note that each target xpath is assumed to be set as a primary key field on the target (reference) class descriptor - this is necessary in order to locate the correct target object instance in the session cache when resolving mapping references. The usesSingleNode flag should be set to true if the keys are to be written out in space-separated lists.
XMLObjectReferenceMapping
,
ContainerMapping
,
Serialized FormField Summary | |
---|---|
protected org.eclipse.persistence.internal.queries.ContainerPolicy |
containerPolicy
|
Fields inherited from class org.eclipse.persistence.oxm.mappings.XMLObjectReferenceMapping |
---|
sourceToTargetKeyFieldAssociations, sourceToTargetKeys |
Fields inherited from class org.eclipse.persistence.mappings.AggregateMapping |
---|
referenceClass, referenceClassName, referenceDescriptor |
Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping |
---|
attributeAccessor, attributeName, descriptor, fields, isLazy, isOptional, isReadOnly, isRemotelyInitialized, NO_FIELDS, NO_WEIGHT, primaryKeyMapping, properties, weight, WEIGHT_1 |
Constructor Summary | |
---|---|
XMLCollectionReferenceMapping()
PUBLIC: The default constructor initializes the sourceToTargetKeyFieldAssociations and sourceToTargetKeys data structures. |
Method Summary | |
---|---|
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(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. |
org.eclipse.persistence.internal.queries.ContainerPolicy |
getContainerPolicy()
INTERNAL: Return the mapping's containerPolicy. |
void |
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: The mapping is initialized with the given session. |
java.lang.Object |
readFromRowIntoObject(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager,
java.lang.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 |
setUsesSingleNode(boolean useSingleNode)
|
void |
useCollectionClass(java.lang.Class concreteContainerClass)
PUBLIC: Configure the mapping to use an instance of the specified container class to hold the target objects. |
void |
useCollectionClassName(java.lang.String concreteContainerClassName)
|
void |
useMapClass(java.lang.Class concreteContainerClass,
java.lang.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(java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractRecord row,
org.eclipse.persistence.internal.sessions.AbstractSession session)
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. |
Methods inherited from class org.eclipse.persistence.oxm.mappings.XMLObjectReferenceMapping |
---|
addSourceToTargetKeyFieldAssociation, cascadePerformRemoveIfRequired, cascadeRegisterNewIfRequired, getFields, getSchemaType, getSingleValueToWriteForUnion, getSourceToTargetKeyFieldAssociations, getValueToWrite, isXMLMapping, setField, setSourceToTargetKeyFieldAssociations |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy
Constructor Detail |
---|
public XMLCollectionReferenceMapping()
Method Detail |
---|
public java.lang.Object buildFieldValue(java.lang.Object targetObject, XMLField xmlFld, org.eclipse.persistence.internal.sessions.AbstractSession session)
buildFieldValue
in class XMLObjectReferenceMapping
targetObject
- - the reference class instance that holds the required pk valuexmlFld
- session
-
public void buildReference(UnmarshalRecord record, XMLField xmlField, java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)
buildReference
in class XMLObjectReferenceMapping
record
- xmlField
- object
- session
- public org.eclipse.persistence.internal.queries.ContainerPolicy getContainerPolicy()
getContainerPolicy
in interface ContainerMapping
getContainerPolicy
in class DatabaseMapping
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
initialize
in class XMLObjectReferenceMapping
DescriptorException
ReferenceResolver
,
NamespaceResolver
public java.lang.Object readFromRowIntoObject(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, java.lang.Object targetObject, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.AbstractSession executionSession) throws DatabaseException
readFromRowIntoObject
in class XMLObjectReferenceMapping
DatabaseException
public void setContainerPolicy(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
setContainerPolicy
in interface ContainerMapping
public void useCollectionClass(java.lang.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 ContainerMapping
public void useCollectionClassName(java.lang.String concreteContainerClassName)
public void useMapClass(java.lang.Class concreteContainerClass, java.lang.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 ContainerMapping
public boolean usesSingleNode()
public void setUsesSingleNode(boolean useSingleNode)
public void writeFromObjectIntoRow(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
writeFromObjectIntoRow
in class XMLObjectReferenceMapping
public void writeSingleValue(java.lang.Object value, java.lang.Object parent, XMLRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)
XMLMapping
writeSingleValue
in interface XMLMapping
writeSingleValue
in class XMLObjectReferenceMapping
value
- - The value to be marshalledrow
- - The Record the value is being marshalled too.
|
EclipseLink1.0 - 20080707 API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |