Jump to: navigation, search

Difference between revisions of "EclipseLink/FAQ/MOXy"

m (added link to 2.4 guide)
(8 intermediate revisions by one other user not shown)
Line 1: Line 1:
 +
{{EclipseLink_DocWiki
 +
|link=http://www.eclipse.org/eclipselink/documentation/2.4/moxy}}
 +
 +
 
__TOC__
 
__TOC__
  
Line 5: Line 9:
 
MOXy is EclipseLink's Object to [http://en.wikipedia.org/wiki/Xml XML] Mapping services.  MOXy allows for a [http://en.wikipedia.org/wiki/Plain_Old_Java_Object POJO] object model to be mapped to an XML schema. The [http://en.wikipedia.org/wiki/JAXB Java Architecture for XML Binding] (JAXB) provides a Java standard for object XML mapping (OXM).  MOXy supports JAXB, as well as providing its' own native API and integration with [http://en.wikipedia.org/wiki/Web_services Web Services].
 
MOXy is EclipseLink's Object to [http://en.wikipedia.org/wiki/Xml XML] Mapping services.  MOXy allows for a [http://en.wikipedia.org/wiki/Plain_Old_Java_Object POJO] object model to be mapped to an XML schema. The [http://en.wikipedia.org/wiki/JAXB Java Architecture for XML Binding] (JAXB) provides a Java standard for object XML mapping (OXM).  MOXy supports JAXB, as well as providing its' own native API and integration with [http://en.wikipedia.org/wiki/Web_services Web Services].
  
== How does EclipseLink MOXy differ from the JAXB reference implementation? ==
+
== Why should EclipseLink MOXy be used? ==
  
EclipseLink MOXy offers additional benefits versus usage of the JAXB reference implementation. These include:
+
EclipseLink MOXy offers additional benefits versus usage of the JAXB 2.1 reference implementation and other similar solutions. The benefits include:  
  
 
* Greater flexibility with meet-in-the-middle mapping  
 
* Greater flexibility with meet-in-the-middle mapping  
Line 13: Line 17:
 
* Specific support for usage with SOA and SCA
 
* Specific support for usage with SOA and SCA
 
* Transaction XML Storage
 
* Transaction XML Storage
 +
* Performance
 +
 +
This more flexible mapping approach is needed to handle mapping to multiple XSDs or XSD versions, sharing a common domain model with other technologies, and usage within other technologies such as SOA and SCA.
  
 
'''Meet in the Middle Mapping'''
 
'''Meet in the Middle Mapping'''
  
In addition to the schema-to-Java and Java-to-schema approaches offered by standard JAXB, EclipseLink JAXB offers meet in the middle mapping.  Meet-in-the-middle mapping allows you to map your own classes to your own XML schema.
+
In addition to the schema-to-Java and Java-to-schema approaches offered by the JAXB 2.1 reference implementation, EclipseLink MOXy offers meet in the middle mapping.  Meet-in-the-middle mapping allows you to map your own classes to your own XML schema avoiding static coupling of your mapped classes with a single XML schema.  
The mapping is XPath based, this breaks the one-to-one correspondence between classes and XML elements in your schema.
+
The mapping isolates the object model from changes in the XML schema and vice versa.
+
  
The mapping is built on the same framework as EclipseLink's object-relational mapping and benefits from all that customer input.
+
* The mapping is XPath based, this breaks the one-to-one correspondence between classes and XML elements in your schema.
There is an external representation for the metadata.  
+
* The mapping isolates the object model from changes in the XML schema and vice versa.
 +
* There is an external XML document representation for the mapping metadata so that JAXB annotations are optional.
 +
* The mapping is built on the same framework as EclipseLink's object-relational mapping and benefits from years of custom use and input as well as many customizable features.  
  
 
'''JPA Compatibility'''
 
'''JPA Compatibility'''
  
EclipseLink JAXB extensions to map compound keys  
+
EclipseLink MOXy offers specific features to address mapping JPA entities to XML
EclipseLink JAXB extensions to map back-pointers  
+
 
When using EclipseLink JPA, EclipseLink MOXy can be made aware of such enhancements as lazy loading and change tracking.  
+
* Mapping of compound keys.
 +
* Mapping of relationship back-pointers and handling during marshaling and marshaling.
 +
* Support usage of EclipseLink JPA specific enhancements for lazy loading and change tracking.  
 +
** ''Note: these enhancements are typically added to the JPA entities through dynamic of static weaving''
  
 
'''EclipseLink JAXB in your SOA'''
 
'''EclipseLink JAXB in your SOA'''
  
EclipseLink JAXB was designed to turn your JPA applications into SOA components.  Through the meet-in-the-middle mapping and JPA compatibility you can map your existing JPA models to industry standard schemas.  
+
EclipseLink JAXB was designed to turn your JPA applications into SOA components.  Through the meet-in-the-middle mapping and JPA compatibility you can map your existing JPA models to industry standard schema.  
 
Not using JAX-WS?  You can use our POJO/SDO bridge to expose your data as SDO (JSR-235, EclipseLink is the RI) Data Objects.  The bridge leverages EclipseLink JAXB.  
 
Not using JAX-WS?  You can use our POJO/SDO bridge to expose your data as SDO (JSR-235, EclipseLink is the RI) Data Objects.  The bridge leverages EclipseLink JAXB.  
  
Line 37: Line 47:
  
 
Interacting with a persistent data store based on XML?  Since EclipseLink MOXy is built on the EclipseLink Foundation you can combine MOXy mappings and EclipseLink's persistence framework to interact with your data through JCA.
 
Interacting with a persistent data store based on XML?  Since EclipseLink MOXy is built on the EclipseLink Foundation you can combine MOXy mappings and EclipseLink's persistence framework to interact with your data through JCA.
 +
 +
'''Performance'''
 +
 +
The EclipseLink MOXy implementation offers superior performance in several scenarios. Each release of EclipseLink continues to incorporate performance improvements with the goal of being superior is as many scenarios as possible while still offering the greater flexibility and integration described above.
  
 
[[Category:EclipseLink FAQ|MOXy]]
 
[[Category:EclipseLink FAQ|MOXy]]

Revision as of 09:59, 23 July 2012


What is EclipseLink MOXy?

MOXy is EclipseLink's Object to XML Mapping services. MOXy allows for a POJO object model to be mapped to an XML schema. The Java Architecture for XML Binding (JAXB) provides a Java standard for object XML mapping (OXM). MOXy supports JAXB, as well as providing its' own native API and integration with Web Services.

Why should EclipseLink MOXy be used?

EclipseLink MOXy offers additional benefits versus usage of the JAXB 2.1 reference implementation and other similar solutions. The benefits include:

  • Greater flexibility with meet-in-the-middle mapping
  • Integrated support for usage with EclipseLink JPA
  • Specific support for usage with SOA and SCA
  • Transaction XML Storage
  • Performance

This more flexible mapping approach is needed to handle mapping to multiple XSDs or XSD versions, sharing a common domain model with other technologies, and usage within other technologies such as SOA and SCA.

Meet in the Middle Mapping

In addition to the schema-to-Java and Java-to-schema approaches offered by the JAXB 2.1 reference implementation, EclipseLink MOXy offers meet in the middle mapping. Meet-in-the-middle mapping allows you to map your own classes to your own XML schema avoiding static coupling of your mapped classes with a single XML schema.

  • The mapping is XPath based, this breaks the one-to-one correspondence between classes and XML elements in your schema.
  • The mapping isolates the object model from changes in the XML schema and vice versa.
  • There is an external XML document representation for the mapping metadata so that JAXB annotations are optional.
  • The mapping is built on the same framework as EclipseLink's object-relational mapping and benefits from years of custom use and input as well as many customizable features.

JPA Compatibility

EclipseLink MOXy offers specific features to address mapping JPA entities to XML

  • Mapping of compound keys.
  • Mapping of relationship back-pointers and handling during marshaling and marshaling.
  • Support usage of EclipseLink JPA specific enhancements for lazy loading and change tracking.
    • Note: these enhancements are typically added to the JPA entities through dynamic of static weaving

EclipseLink JAXB in your SOA

EclipseLink JAXB was designed to turn your JPA applications into SOA components. Through the meet-in-the-middle mapping and JPA compatibility you can map your existing JPA models to industry standard schema. Not using JAX-WS? You can use our POJO/SDO bridge to expose your data as SDO (JSR-235, EclipseLink is the RI) Data Objects. The bridge leverages EclipseLink JAXB.

Transactional XML Storage

Interacting with a persistent data store based on XML? Since EclipseLink MOXy is built on the EclipseLink Foundation you can combine MOXy mappings and EclipseLink's persistence framework to interact with your data through JCA.

Performance

The EclipseLink MOXy implementation offers superior performance in several scenarios. Each release of EclipseLink continues to incorporate performance improvements with the goal of being superior is as many scenarios as possible while still offering the greater flexibility and integration described above.