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
July 23, 2010
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).
July 20, 2010
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.
July 14, 2010
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
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
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