This chapter explains how to create descriptor options specific to an XML descriptor.
This chapter includes the following sections:
For information on how to create more than one type of descriptor, see Chapter 118, "Creating a Descriptor".
After you create a descriptor, you must configure its various options (see Chapter 119, "Configuring a Descriptor") and use it to define mappings.
For complete information on the various types of mapping that TopLink supports, see Chapter 17, "Introduction to Mappings" and Chapter 120, "Creating a Mapping"
.
For complete information on the various types of descriptor that TopLink supports, see Section 16.1, "Descriptor Types".
For more information, see the following:
You can create an XML descriptor using Oracle JDeveloper TopLink Editor, TopLink Workbench (see Section 51.2.1, "How to Create an XML Descriptor Using TopLink Workbench"), or Java code (see Section 51.2.2, "How to Create an XML Descriptor Using Java"
).
When you add a class to an XML project (see Section 117.3, "Configuring Project Classpath"), TopLink Workbench creates an XML descriptor for the class.
An XML descriptor is always a composite type.
Example 51-1 shows how to create an XML descriptor using Java code.
Example 51-1 Creating an XML Descriptor in Java
XMLDescriptor descriptor = new XMLDescriptor(); descriptor.setJavaClass(YourClass.class);
Note:
Use theoracle.toplink.ox.XMLDescriptor
class. Do not use the deprecated oracle.toplink.xml
.
XMLDescriptor
class.