Jump to: navigation, search


< EclipseLink‎ | Examples‎ | MOXy
Revision as of 20:35, 15 June 2010 by Douglas.clarke.oracle.com (Talk | contribs) (How to use eclipselink-orm.xml)

EclipseLink supports the use of JAXB with externalized mapping files. These mapping files support specifying the Object-XML binding of JAXB 2.2 annotations plus many of the advanced mapping and configuration options provided by EclipseLink MOXy.

How to use eclipselink-orm.xml

In order to specify the mappings between domain objects and an XSD an application must provide:

  1. An XML mapping file per package
  2. A JAXB.properties file specifying EclipseLink as the JAXB implementation

Example Mapping File: /model/eclipselink-oxm.xml

<?xml version="1.0" encoding="US-ASCII"?>
	xsi:schemaLocation="http://www.eclipse.org/eclipselink/xsds/persistence/orm http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_1.xsd"
        <java-type name="mynamespace.Person">
            <xml-root-element name="person"/>
                <xml-element java-attribute="name" />

Specifying the EclipseLink MOXy Runtime

To specify the EclipseLink MOXy (JAXB) runtime should be used you need to add a file called jaxb.properties in the same package as the domain classes with the following entry.


Specifying the mapping files

In order to configure EclipseLink MOXy to use the mapping files ...