I am developing a set of REST services. I am planning to use Hibernate as my ORM and JAXB as my business objects to simplify marshalling and unmarshalling. In this case, I have to always map Hibernate objects to JAXB object and other way around! Is there any more efficient standard architecture for this purpose?
Share
Using hibernate via JPA annotations, you can create a class that can be used by both JAXB for marshalling and unmarshalling, and by Hibernate for persistence.
If you are trying to keep the two strictly separate–that is, you don’t want JPA annotations and JAXB annotations to coexist on the same class–then you will need to map between the two.