This chapter describes the various components that you must configure in order to use a relational direct-to-XMLType
mapping.
This chapter includes the following sections:
For information on how to configure TopLink mappings options common to two or more mapping types, see Chapter 121, "Configuring a Mapping".
For information on how to create TopLink mappings, see Chapter 120, "Creating a Mapping".
Table 30-1 lists the configurable options for a relational direct-to-XMLType
mapping.
Table 30-1 lists the configurable options for a relational direct-to-XMLType
mapping.
Table 30-1 Configurable Options for Relational Direct-To-XMLType Mapping
Option to Configure | Oracle JDeveloper |
TopLink Workbench |
Java |
---|---|---|---|
Database field (see Section 28.3, "Configuring a Database Field") |
|||
Method or direct field access (see Section 121.6, "Configuring Method or Direct Field Accessing at the Mapping Level") |
|||
Read-only (see Section 121.2, "Configuring Read-Only Mappings") |
|||
Read whole document (see Section 30.2, "Configuring Read Whole Document") |
|||
Mapping comments (see Section 121.8, "Configuring Mapping Comments") |
Example 30-1 shows how to create a direct-to-XMLType
mapping and add it to a descriptor using Java code.
Example 30-1 Direct-to-XMLType Mapping
public void customize(ClassDescriptor descriptor) { DirectToXMLTypeMapping mapping = new DirectToXMLTypeMapping(); // configure mapping ... // add mapping to descriptor descriptor.addMapping(mapping); }
For more information, see the following:
When mapping an XML Type to a Document Object Model (DOM), by default TopLink uses the database representation of the DOM. This allows for lazy loading of the XML data from the database.
However, if you require the entire DOM, (or if you require the DOM to be available in a disconnected fashion from the database connection) use the Read Whole option to retrieve the entire DOM from the database.
To specify that this mapping reads the whole XML document, use this procedure:
Select the mapping in the Navigator. Its properties appear in the Editor.
Click General. The General tab appears.
Figure 30-1 DIrect to XML Mapping Property Sheet, Read Whole Document Option
Choose the Read Whole Document option to read the whole XML document. If you do not select this option, the connection must remain open for TopLink to read the database values.
Use the following DirectToXMLTypeMapping
methods:
setShouldReadWholeDocument
shouldReadWholeDocument
For more information about the available methods for DirectToXMLTypeMapping
, see the Oracle Fusion Middleware Java API Reference for Oracle TopLink.