JAXB is your best choice when binding Java objects to XML. But what happens when those Java objects turn out to be JPA entities? For the most part it is business as usual, although there are a couple things to be aware of. In this post we'll cover a MOXy extension that can be used to map a bidirectional relationship.
July 26, 2010
JPA Entities to XML - Bidirectional Relationships
Labels:
EclipseLink,
Extension,
JAXB,
JPA,
MOXy,
XmlInverseReference
July 23, 2010
MOXy JAXB - Map Interfaces to XML
I recently came across a Twitter message (tweet) complaining that JAXB does not support binding Java interfaces to XML. Below I'll describe how this can be accomplished using MOXy in the upcoming EclipseLink 2.1.1 and 2.2 releases (try it now).
Labels:
EclipseLink,
Extension,
Interface,
JAXB,
MOXy
July 20, 2010
JAXB - The XML Binding Standard
Many people think of JAXB as an implementation (the reference implementation included in Java SE 6). In reality JAXB is a Java Community Process (JCP) specification with multiple implementations (such as EclipseLink MOXy). In this post I'll discuss the importance of JAXB the standard.
Labels:
EclipseLink,
JAXB,
jaxb.properties,
MOXy,
Specification,
TopLink
July 14, 2010
XPath Based Mapping
In this post we'll explore the XPath based mapping aspect of EclipseLink JAXB (MOXy). XPath based mapping is what allows an existing object model to be mapped to an existing XML schema. MOXy is the only XML binding solution I'm aware of with this ability and therefore the only true object-to-XML mapper (OXM).
July 13, 2010
CDATA, CDATA Run, Run Data Run
Recently the topic of JAXB's handling of CDATA has come up on a few separate Twitter messages (tweets). In this post I will describe how to handle CDATA using EclipseLink JAXB (MOXy).
July 12, 2010
XmlAdapter - JAXB's Secret Weapon
The XmlAdapter mechanism in JAXB ensures that there is no such thing as an unmappable class (with a little programmatic help). However there appears to be some confusion on how to use XmlAdapter, below is the general concept:
- Identify the unmappable class
- Create an equivalent class that is mappable
- Create an XmlAdapter to convert between unmappable and mappable objects
- Specify the XmlAdapter
Subscribe to:
Posts (Atom)