Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merging Hibernate Objects and JAXB Object

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?

like image 342
Nami Avatar asked Nov 05 '22 10:11

Nami


1 Answers

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.

like image 117
simpleton Avatar answered Nov 15 '22 09:11

simpleton