Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Configuring an XML Mapping (ELUG)"
m (→Introduction to XML Mapping Configuration) |
|||
Line 9: | Line 9: | ||
==Introduction to XML Mapping Configuration== | ==Introduction to XML Mapping Configuration== | ||
− | |||
This table lists the types of XML mappings that you can configure and provides a cross-reference to the type-specific chapter that lists the configurable options supported by that type. | This table lists the types of XML mappings that you can configure and provides a cross-reference to the type-specific chapter that lists the configurable options supported by that type. | ||
− | |||
<span id="Table 59-1"></span> | <span id="Table 59-1"></span> | ||
Line 60: | Line 58: | ||
For more information, see the following: | For more information, see the following: | ||
− | |||
* [[Introduction%20to%20Mappings%20(ELUG)|Introduction to Mappings]] | * [[Introduction%20to%20Mappings%20(ELUG)|Introduction to Mappings]] | ||
* [[Introduction%20to%20XML%20Mappings%20(ELUG)|Introduction to XML Mappings]] | * [[Introduction%20to%20XML%20Mappings%20(ELUG)|Introduction to XML Mappings]] | ||
− | |||
− | |||
− | |||
+ | ==Configuring Common XML Mapping Options== | ||
+ | This table lists the configurable options shared by two or more XML mapping types. In addition to the configurable options described here, you must also configure the options described for the specific [[Introduction%20to%20XML%20Mappings%20(ELUG)|XML Mapping Types]], as shown in [[#Table 59-1|Configuring XML Mappings]]. | ||
− | |||
+ | <span id="Table 59-2"></span> | ||
+ | ''''' Common Options for XML Mappings''''' | ||
{| class="RuleFormalMax" dir="ltr" title="Common Options for XML Mappings" summary="This table lists the configurable options shared by two or more XML mapping types and categorizes them as Basic and Advanced and indicates if the option can be configured with the EclipseLink Workbench, Java, or both." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" | {| class="RuleFormalMax" dir="ltr" title="Common Options for XML Mappings" summary="This table lists the configurable options shared by two or more XML mapping types and categorizes them as Basic and Advanced and indicates if the option can be configured with the EclipseLink Workbench, Java, or both." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
Line 163: | Line 160: | ||
|} | |} | ||
− | + | ||
+ | |||
==Configuring Reference Descriptor== | ==Configuring Reference Descriptor== | ||
− | |||
For XML attributes that reference other descriptors (instead of a schema element), you may select a specific reference descriptor. If you do not specify a reference descriptor, EclipseLink uses the <tt>xsi:Type</tt> attribute to determine the reference class object. | For XML attributes that reference other descriptors (instead of a schema element), you may select a specific reference descriptor. If you do not specify a reference descriptor, EclipseLink uses the <tt>xsi:Type</tt> attribute to determine the reference class object. | ||
− | + | This table summarizes which XML mappings support reference descriptor configuration. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | <span id="Table 59-3"></span> | ||
+ | ''''' XML Mapping Support for Reference Descriptor Configuration''''' | ||
{| class="RuleFormal" dir="ltr" title="XML Mapping Support for Reference Descriptor Configuration" summary="This table summarizes which XML mappings support reference descriptor configuration." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" | {| class="RuleFormal" dir="ltr" title="XML Mapping Support for Reference Descriptor Configuration" summary="This table summarizes which XML mappings support reference descriptor configuration." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
! id="r1c1-t4" align="left" valign="bottom" | '''XML Mapping''' | ! id="r1c1-t4" align="left" valign="bottom" | '''XML Mapping''' | ||
− | ! id="r1c2-t4" align="left" valign="bottom" | '''[[#How to Configure a Reference Descriptor Using Workbench]]<br>''' | + | ! id="r1c2-t4" align="left" valign="bottom" | '''[[#How to Configure a Reference Descriptor Using Workbench|Using the Workbench]]<br>''' |
! id="r1c3-t4" align="left" valign="bottom" | '''How to Use Java''' | ! id="r1c3-t4" align="left" valign="bottom" | '''How to Use Java''' | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
Line 234: | Line 229: | ||
===How to Configure a Reference Descriptor Using Workbench=== | ===How to Configure a Reference Descriptor Using Workbench=== | ||
− | |||
To specify a reference descriptor for an XML mapping that references another descriptor (instead of a schema element), use this procedure. | To specify a reference descriptor for an XML mapping that references another descriptor (instead of a schema element), use this procedure. | ||
# Select the mapped attribute in the '''Navigator'''. Its properties appear in the Editor. | # Select the mapped attribute in the '''Navigator'''. Its properties appear in the Editor. | ||
− | # Click the '''General''' tab. The General tab appears.''''' | + | # Click the '''General''' tab. The General tab appears.''''' General Tab, Reference Descriptor Field'''''<br>[[Image:xmlrefd.gif|General Tab, Reference Descriptor Field]]<br><br> |
+ | #If this XML attribute refers to another descriptor (instead of a schema element), use the '''Reference Descriptor''' field to select a descriptor in the project. | ||
− | |||
− | |||
− | |||
==Configuring Maps to Wildcard== | ==Configuring Maps to Wildcard== | ||
+ | This attribute applies only to the Workbench. Use this option to solve "No XPath specified" problems (see [[Using%20Workbench%20(ELUG)#How to Use the Problems Window|How to Use the Problems Window]]) for an XML mapping that does not need an XPath (see [[Configuring%20a%20Mapping%20(ELUG)#Configuring XPath|Configuring XPath]]) for it maps to a wildcard. | ||
− | + | If the XML mapping is owned by an <tt>anyType</tt> descriptor (see [[Configuring%20an%20XML%20Descriptor%20(ELUG)#Configuring for Complex Type of anyType|Configuring for Complex Type of anyType]]), it cannot map to a wildcard, and you must specify an XPath. | |
− | + | This table summarizes which XML mappings support maps to wildcard configuration. | |
− | |||
− | |||
− | |||
− | |||
− | |||
+ | <span id="Table 59-4"></span> | ||
+ | ''''' XML Mapping Support for Maps to Wildcard Configuration''''' | ||
{| class="RuleFormal" dir="ltr" title="XML Mapping Support for Maps to Wildcard Configuration" summary="This table summarizes which XML mappings support maps to wildcard configuration." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" | {| class="RuleFormal" dir="ltr" title="XML Mapping Support for Maps to Wildcard Configuration" summary="This table summarizes which XML mappings support maps to wildcard configuration." width="100%" border="1" frame="border" rules="all" cellpadding="3" frame="border" rules="all" | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
! id="r1c1-t5" align="left" valign="bottom" | '''XML Mapping''' | ! id="r1c1-t5" align="left" valign="bottom" | '''XML Mapping''' | ||
− | ! id="r1c2-t5" align="left" valign="bottom" | '''[[#How to Configure Maps to Wildcard Using Workbench]]''' | + | ! id="r1c2-t5" align="left" valign="bottom" | '''[[#How to Configure Maps to Wildcard Using Workbench|Using the Workbench]]''' |
! id="r1c3-t5" align="left" valign="bottom" | '''How to Use Java''' | ! id="r1c3-t5" align="left" valign="bottom" | '''How to Use Java''' | ||
|- align="left" valign="top" | |- align="left" valign="top" | ||
Line 314: | Line 304: | ||
|} | |} | ||
− | + | ||
+ | |||
+ | |||
===How to Configure Maps to Wildcard Using Workbench=== | ===How to Configure Maps to Wildcard Using Workbench=== | ||
− | |||
To specify a map a schema element using the <tt>xs:any</tt> declaration, use this procedure. | To specify a map a schema element using the <tt>xs:any</tt> declaration, use this procedure. | ||
# Select the mapped attribute in the '''Navigator'''. Its properties appear in the Editor. | # Select the mapped attribute in the '''Navigator'''. Its properties appear in the Editor. | ||
− | # ''''' | + | # '''''Mapping Tab, Maps to Wildcard Option'''''<br>[[Image:wildcard.gif|Mapping Tab, Maps to Wildcard Option]]<br><br> |
− | + | #If the XML mapping is not owned by an <tt>anyType</tt> descriptor (see [[Configuring%20an%20XML%20Descriptor%20(ELUG)#Configuring for Complex Type of anyType|Configuring for Complex Type of anyType]]) and maps to a wildcard, then you do not need to specify an XPath (see [[Configuring%20a%20Mapping%20(ELUG)#Configuring XPath|Configuring XPath]]). Select the '''Maps to Wildcard (uses "any" tag)''' option to clear the missing XPath neediness message. | |
− | If the XML mapping is not owned by an <tt>anyType</tt> descriptor (see [[Configuring%20an%20XML%20Descriptor%20(ELUG)|Configuring for Complex Type of anyType]]) and maps to a wildcard, then you do not need to specify an XPath (see [[Configuring%20a%20Mapping%20(ELUG)|Configuring XPath]]). Select the '''Maps to Wildcard (uses "any" tag)''' option to clear the missing XPath neediness message. | + | #If the XML mapping is owned by an <tt>anyType</tt> descriptor, it cannot map to a wildcard and you must specify an XPath. Deselect the '''Maps to Wildcard (Uses "any" tag)''' option and ensure that you specify an XPath. |
− | + | ||
− | If the XML mapping is owned by an <tt>anyType</tt> descriptor, it cannot map to a wildcard and you must specify an XPath. Deselect the '''Maps to Wildcard (Uses "any" tag)''' option and ensure that you specify an XPath. | + | |
− | + | ||
− | + | ||
− | |||
Revision as of 13:04, 4 December 2007
Contents
This section describes how to configure an XML mapping.
For information on how to configure EclipseLink mappings options common to two or more mapping types, see Configuring a Mapping.
Introduction to XML Mapping Configuration
This table lists the types of XML mappings that you can configure and provides a cross-reference to the type-specific chapter that lists the configurable options supported by that type.
Configuring XML Mappings
Mapping Type | See Also... |
---|---|
XML direct mapping (see XML Direct Mapping) |
|
XML composite direct collection mapping (see XML Composite Direct Collection Mapping) |
|
XML composite object mapping (see XML Composite Object Mapping) |
|
XML composite collection mapping (see XML Composite Collection Mapping) |
|
XML any object mapping (see XML Any Object Mapping) |
|
XML any collection mapping (see XML Any Collection Mapping) |
|
XML transformation mapping (see XML Transformation Mapping |
For more information, see the following:
Configuring Common XML Mapping Options
This table lists the configurable options shared by two or more XML mapping types. In addition to the configurable options described here, you must also configure the options described for the specific XML Mapping Types, as shown in Configuring XML Mappings.
Common Options for XML Mappings
Option | EclipseLink Workbench | Java |
---|---|---|
Configuring Method or Direct Field Accessing at the Mapping Level |
||
Configuring Reference Descriptor
For XML attributes that reference other descriptors (instead of a schema element), you may select a specific reference descriptor. If you do not specify a reference descriptor, EclipseLink uses the xsi:Type attribute to determine the reference class object.
This table summarizes which XML mappings support reference descriptor configuration.
XML Mapping Support for Reference Descriptor Configuration
XML Mapping | Using the Workbench |
How to Use Java |
---|---|---|
XML direct mapping (see XML Direct Mapping) |
||
XML composite direct collection mapping (seeXML Composite Direct Collection Mapping) |
||
XML composite object mapping (see XML Composite Object Mapping) |
||
XML composite collection mapping (see XML Composite Collection Mapping) |
||
XML any object mapping (see XML Any Object Mapping) |
||
XML any collection mapping (see XML Any Collection Mapping) |
||
XML transformation mapping (see XML Transformation Mapping) |
How to Configure a Reference Descriptor Using Workbench
To specify a reference descriptor for an XML mapping that references another descriptor (instead of a schema element), use this procedure.
- Select the mapped attribute in the Navigator. Its properties appear in the Editor.
- Click the General tab. The General tab appears. General Tab, Reference Descriptor Field
- If this XML attribute refers to another descriptor (instead of a schema element), use the Reference Descriptor field to select a descriptor in the project.
Configuring Maps to Wildcard
This attribute applies only to the Workbench. Use this option to solve "No XPath specified" problems (see How to Use the Problems Window) for an XML mapping that does not need an XPath (see Configuring XPath) for it maps to a wildcard.
If the XML mapping is owned by an anyType descriptor (see Configuring for Complex Type of anyType), it cannot map to a wildcard, and you must specify an XPath.
This table summarizes which XML mappings support maps to wildcard configuration.
XML Mapping Support for Maps to Wildcard Configuration
XML Mapping | Using the Workbench | How to Use Java |
---|---|---|
XML direct mapping (see XML Direct Mapping) |
||
XML composite direct collection mapping (see XML Composite Direct Collection Mapping) |
||
XML composite object mapping (see XML Composite Object Mapping) |
||
XML composite collection mapping (see XML Composite Collection Mapping) |
||
XML any object mapping (see XML Any Object Mapping) |
||
XML any collection mapping (see XML Any Collection Mapping) |
||
XML transformation mapping (see XML Transformation Mapping) |
How to Configure Maps to Wildcard Using Workbench
To specify a map a schema element using the xs:any declaration, use this procedure.
- Select the mapped attribute in the Navigator. Its properties appear in the Editor.
- Mapping Tab, Maps to Wildcard Option
- If the XML mapping is not owned by an anyType descriptor (see Configuring for Complex Type of anyType) and maps to a wildcard, then you do not need to specify an XPath (see Configuring XPath). Select the Maps to Wildcard (uses "any" tag) option to clear the missing XPath neediness message.
- If the XML mapping is owned by an anyType descriptor, it cannot map to a wildcard and you must specify an XPath. Deselect the Maps to Wildcard (Uses "any" tag) option and ensure that you specify an XPath.