Composite object XML mappings represent a relationship between two classes. In XML, the "owned"
class may be nested with the element tag representing the "owning" class. This mapping is, by
definition, privately owned.

Composite object XML mappings can be used in the following scenarios:

Mapping into the Parent Record

Mapping to an Element

Mapping to Different Elements by Element Name

Mapping to Different Elements by Element Position

Setting the XPath: TopLink XML mappings make use of XPath statements to find the relevant
data in an XML document. The XPath statement is relative to the context node specified in the descriptor.
The XPath may contain path and positional information; the last node in the XPath forms the local
root node for the composite object. The XPath is specified on the mapping using the setXPath
method.

The following XPath statements may be used to specify the location of XML data relating to an object's
name attribute:

XPath

Description

.

Indicates "self".

phone-number

The phone-number information is stored in the phone-number element.

contact-info/phone-number

The XPath statement may be used to specify any valid path.

phone-number[2]

The XPath statement may contain positional information. In this case the phone-number
information is stored in the second occurrence of the phone-number element.

Mapping into the Parent Record: The composite object may be mapped into the parent
record in a corresponding XML document.

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,
ObjectBuildingQuery sourceQuery,
org.eclipse.persistence.internal.sessions.AbstractSession executionSession)
INTERNAL:
Extract value from the row and set the attribute to this value in the object.

void

setAttributeValueInObject(java.lang.Object object,
java.lang.Object value)
INTERNAL:
Set the value of the attribute mapped by this mapping.

writeSingleValue(java.lang.Object value,
java.lang.Object parent,
XMLRecord record,
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.

setContainerAttributeName

Deprecated.Replaced by getInverseReferenceMapping().setAttributeName()

Sets the name of the backpointer attribute on the target object. Used to
populate the backpointer. If the specified attribute doesn't exist on
the reference class of this mapping, a DescriptorException will be thrown
during initialize.

Parameters:

attributeName - - the name of the backpointer attribute to be populated

getContainerAttributeName

@Deprecated
public java.lang.String getContainerAttributeName()

Deprecated.Replaced by getInverseReferenceMapping().getAttributeName()

Gets the name of the backpointer attribute on the target object. Used to
populate the backpointer.

setContainerGetMethodName

Deprecated.Replaced by getInverseReferenceMapping().setGetMethodName()

Sets the method name to be used when accessing the value of the back pointer
on the target object of this mapping. If the specified method doesn't exist
on the reference class of this mapping, a DescriptorException will be thrown
during initialize.

Parameters:

methodName - - the getter method to be used.

setContainerSetMethodName

Deprecated.Replaced by getInverseReferenceMapping().setSetMethodName()

Sets the name of the method to be used when setting the value of the back pointer
on the target object of this mapping. If the specified method doesn't exist
on the reference class of this mapping, a DescriptorException will be thrown
during initialize.

Parameters:

methodName - - the setter method to be used.

getContainerGetMethodName

@Deprecated
public java.lang.String getContainerGetMethodName()

Deprecated.Replaced by getInverseReferenceMapping().getGetMethodName()

Gets the name of the method to be used when accessing the value of the
back pointer on the target object of this mapping.

getContainerSetMethodName

@Deprecated
public java.lang.String getContainerSetMethodName()

Deprecated.Replaced by getInverseReferenceMapping().getSetMethodName()

Gets the name of the method to be used when setting the value of the
back pointer on the target object of this mapping.