I'm trying to find a way to accomplish a xsd schema to datastore roundtrip, with minimum effort.
I used jaxb to build my object model from schemas, now I would like to store these objects based on JPA (or JDO or something else?). Is it possible, to auto enhance the objects with the missing annotations based on the JAXB Annotations? Is it desirable?
Thanks
You have several options for this use case.
Option #1 - Hyperjaxb3
I have not used this myself, but Hyperjaxb3 is supposed to generate both JAXB and JPA annotations on the model:
Option #2 - Use Dali to map your POJOs to Database (JPA)
The Eclipse Dali tool provides tooling to easily map your POJOs to a relational database using JPA:
Option #3 - Use EclipseLink
EclipseLink provides both JPA and JAXB implementations. The JAXB implementation (MOXy) contains extensions specifically for handling JPA entities:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With