Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Creating an XML Descriptor (ELUG)"

m (Creating an XML Descriptor)
m
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
[[Image:Elug draft icon.png]] '''For the latest EclipseLink documentation, please see http://www.eclipse.org/eclipselink/documentation/ '''
 +
 +
----
 
<div style="float:right;border:1px solid #000000;padding:5px">__TOC__
 
<div style="float:right;border:1px solid #000000;padding:5px">__TOC__
 
[[Special:Whatlinkshere/Creating an XML Descriptor (ELUG)|Related Topics]]</div>
 
[[Special:Whatlinkshere/Creating an XML Descriptor (ELUG)|Related Topics]]</div>
Line 4: Line 7:
  
 
For information on how to create more than one type of descriptor, see [[Creating%20a%20Descriptor%20(ELUG)|Creating a Descriptor]].
 
For information on how to create more than one type of descriptor, see [[Creating%20a%20Descriptor%20(ELUG)|Creating a Descriptor]].
 
 
 
==Introduction to XML Descriptor Creation==
 
  
 
After you create a descriptor, you must configure its various options (see [[Configuring%20a%20Descriptor%20(ELUG)|Configuring a Descriptor]]) and use it to define mappings.
 
After you create a descriptor, you must configure its various options (see [[Configuring%20a%20Descriptor%20(ELUG)|Configuring a Descriptor]]) and use it to define mappings.
Line 13: Line 12:
 
For complete information on the various types of mapping that EclipseLink supports, see [[Introduction%20to%20Mappings%20(ELUG)|Introduction to Mappings]] and [[Creating%20a%20Mapping%20(ELUG)|Creating a Mapping]].
 
For complete information on the various types of mapping that EclipseLink supports, see [[Introduction%20to%20Mappings%20(ELUG)|Introduction to Mappings]] and [[Creating%20a%20Mapping%20(ELUG)|Creating a Mapping]].
  
For complete information on the various types of descriptor that EclipseLink supports, see [[Introduction%20to%20Descriptors%20(ELUG)|Descriptor Types]].
+
For complete information on the various types of descriptor that EclipseLink supports, see [[Introduction%20to%20Descriptors%20(ELUG)#Descriptor Types|Descriptor Types]].
  
 
For more information, see the following:
 
For more information, see the following:
 
 
* [[Introduction%20to%20Descriptors%20(ELUG)|Introduction to Descriptors]]
 
* [[Introduction%20to%20Descriptors%20(ELUG)|Introduction to Descriptors]]
 
* [[Introduction%20to%20XML%20Descriptors%20(ELUG)|Introduction to XML Descriptors]]
 
* [[Introduction%20to%20XML%20Descriptors%20(ELUG)|Introduction to XML Descriptors]]
Line 23: Line 21:
  
 
==Creating an XML Descriptor==
 
==Creating an XML Descriptor==
 
 
You can create an XML descriptor using the [[#How to Create an XML Descriptor Using Workbench|Workbench]] or [[#How to Create an XML Descriptor Using Java|Java code]]. We recommend that you use the Workbench to create and manage your XML descriptors.
 
You can create an XML descriptor using the [[#How to Create an XML Descriptor Using Workbench|Workbench]] or [[#How to Create an XML Descriptor Using Java|Java code]]. We recommend that you use the Workbench to create and manage your XML descriptors.
  
Line 29: Line 26:
  
 
===How to Create an XML Descriptor Using Workbench===
 
===How to Create an XML Descriptor Using Workbench===
 
+
[[Image:xmldesin.gif|XML descriptor icon]] When you add a class to an XML project (see [[Configuring%20a%20Project%20(ELUG)#Configuring Project Classpath|Configuring Project Classpath]]), Workbench creates an XML descriptor for the class.
[[Image:xmldesin.gif|XML descriptor icon]] When you add a class to an XML project (see [[Configuring%20a%20Project%20(ELUG)|Configuring Project Classpath]]), Workbench creates an XML descriptor for the class.
+
  
 
An XML descriptor is always a composite type.
 
An XML descriptor is always a composite type.
Line 37: Line 33:
  
 
===How to Create an XML Descriptor Using Java===
 
===How to Create an XML Descriptor Using Java===
 
 
This example shows how to create an XML descriptor using Java code.
 
This example shows how to create an XML descriptor using Java code.
  
Line 59: Line 54:
  
 
[[Category: EclipseLink User's Guide]]
 
[[Category: EclipseLink User's Guide]]
[[Category: Draft]]
+
[[Category: Release 1]]
 
[[Category: Task]]
 
[[Category: Task]]
 +
[[Category: XML]]

Latest revision as of 11:10, 23 July 2012

Elug draft icon.png For the latest EclipseLink documentation, please see http://www.eclipse.org/eclipselink/documentation/


This section explains how to create descriptor options specific to an XML descriptor.

For information on how to create more than one type of descriptor, see Creating a Descriptor.

After you create a descriptor, you must configure its various options (see Configuring a Descriptor) and use it to define mappings.

For complete information on the various types of mapping that EclipseLink supports, see Introduction to Mappings and Creating a Mapping.

For complete information on the various types of descriptor that EclipseLink supports, see Descriptor Types.

For more information, see the following:


Creating an XML Descriptor

You can create an XML descriptor using the Workbench or Java code. We recommend that you use the Workbench to create and manage your XML descriptors.


How to Create an XML Descriptor Using Workbench

XML descriptor icon When you add a class to an XML project (see Configuring Project Classpath), Workbench creates an XML descriptor for the class.

An XML descriptor is always a composite type.


How to Create an XML Descriptor Using Java

This example shows how to create an XML descriptor using Java code.


Creating an XML Descriptor in Java

XMLDescriptor descriptor = new XMLDescriptor();
descriptor.setJavaClass(YourClass.class);


Note: Use the org.eclipse.persistence.ox.XMLDescriptor class. Do not use the deprecated org.eclipse.persistence.internal.xml.XMLDescriptor class.



Copyright Statement

Back to the top