user3364298
user3364298

Reputation: 13

JAXB and JPA to persist data in DB

i have a problem statement where i have XML and i need to take some data out of it using xslt and map it into another schema which complies to tables in db.

so in short i am trying to convert one xml to another for which i dont have XSD. and then persist that XML using JPA and JAXB annotation at same time.

i am so confused for it.

i have gone through various tutorial but not got any help as such.

do we have mechanism to generate class with both annotation with DB tables. any live example would be of great help.

thanks in advance.!

Upvotes: 1

Views: 211

Answers (1)

lexicore
lexicore

Reputation: 43661

do we have mechanism to generate class with both annotation with DB tables.

This is what Hyperjaxb3 essentially does.

HJ3 is a JAXB plugin which makes generated classes directly JPA-compatible. It adds the required JPA annotations and in certain cases fixes/workarounds the JAXB/JPA incompatibilities.

any live example would be of great help.

Please see the Purchase Order Tutorial.

Disclaimer: I am the author of Hyperjaxb3.

Please use the for ruther questions on HJ3.

Upvotes: 1

Related Questions