views:

79

answers:

2

If I want an ORM that helps me to develop a "database agnostic" application, then Hibernate would be a good fit, but if I need to map entities or objects to nodes in an XML file, then JAXB would be the right type of technology... would that be a correct assessment?

A: 

Yes, JAXB is intended for binding Java objects to XML and vice-versa. It is not an exact analogy, imo, but I think I see what you are getting at. :)

jsight
+1  A: 

More accurately, JAXB is to XML as JPA is to a database schema.

JAXB and JPA are specifications with multiple implementations. Where JPA has TopLink/EclipseLink, Hibernate, ... JAXB has TopLink/EclipseLink, Metro, ...

Blaise Doughan