Fusion Middleware Developer's Guide for Oracle TopLink
ContentsOpens a new window
Opens a new window
Page 72 of 158

51 Creating an XML Descriptor

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"Opens a new window.

51.1 Introduction to XML Descriptor Creation

After you create a descriptor, you must configure its various options (see Chapter 119, "Configuring a Descriptor"Opens a new window) and use it to define mappings.

For complete information on the various types of mapping that TopLink supports, see Chapter 17, "Introduction to Mappings"Opens a new window and Chapter 120, "Creating a Mapping"Opens a new window.

For complete information on the various types of descriptor that TopLink supports, see Section 16.1, "Descriptor Types"Opens a new window.

For more information, see the following:

51.2 Creating an XML Descriptor

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"Opens a new window), or Java code (see Section 51.2.2, "How to Create an XML Descriptor Using Java"Opens a new window).

51.2.1 How to Create an XML Descriptor Using TopLink Workbench

XML descriptor icon
When you add a class to an XML project (see Section 117.3, "Configuring Project Classpath"Opens a new window), TopLink Workbench creates an XML descriptor for the class.

An XML descriptor is always a composite type.

51.2.2 How to Create an XML Descriptor Using Java

Example 51-1Opens a new window 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 the oracle.toplink.ox.XMLDescriptor class. Do not use the deprecated oracle.toplink.xml.XMLDescriptor class.