Oracle TopLink Developer's Guide 10g Release 3 (10.1.3) B13593-01 |
|
![]() Previous |
![]() Next |
For the XML-based mappings that Table 35-6 summarizes, when you map a list value, you can configure whether or not the mapping unmarshalls (writes) the list to a single node, like <item>aaa bbb ccc</item>
, or to multiple nodes, like:
<item>aaa</item> <item>bbb</item> <item>ccc</item>
Table 35-6 summarizes which mappings support this option.
Table 35-20 Mapping Support for Use Single Node
Mapping | Using TopLink Workbench |
Using Java |
---|---|---|
|
![]() |
|
EIS Composite Direct Collection Mapping |
|
|
|
||
|
![]() |
|
XML Composite Direct Collection Mapping |
|
|
Footnote 1 When used with XML records only (see "Configuring Record Format").
To configure a mapping to use a single node, use this procedure.
Select the mapped attribute in the Navigator. Its properties appear in the Editor.
Click the General tab. The General tab appears.
Figure 35-19 General Tab, Use Single Node Option
To configure the mapping to unmarshall (write) a list value to a single node (like <item>aaa bbb ccc</item>
), click Use single node.
By default, the mapping unmarshalls a list value to separate nodes.
Use AbstractCompositeDirectCollectionMapping
method setUsesSingleNode
to configure the mapping to write a list value to a single node by passing in a value of true
. To configure the mapping to write a list value to multiple nodes, pass in a value of false
.
For any mapping that takes an XMLField
, use XMLField
method setUsesSingleNode
to configure the mapping to write a list value to a single node by passing in a value of true
. To configure the mapping to write a list value to multiple nodes, pass in a value of false
. Example 35-17 shows how to use this method with an XMLDirectMapping
: