• Post Reply Bookmark Topic Watch Topic
  • New Topic

JAXB persistency

 
naveen velicheti
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am developing a web service in which there are JAXB generated objects and hibernate objects in the back-end for persistence.
In my operation,
I have to retrieve data from data base using hibernate and map those objects to JAXB objects,
I am doing that this way

JaxBObject.setName(HibernateObject.getName()); (//sample)

As the complexity of the objects increases my java coding will also increase to a great extent
Now I would like to know if someone could give me a good solution of persisting these JAXB objects via hibernate objects

I am not sure if any xslt mapping might help me here (after converting hibernate objects into xsds)

Thanks in advance
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Would you consider persisting instances of the JAXB generated classes?
If so, a solution may be to add persistence code etc. to these classes using AspectJ. This in order not to have to touch the JAXB generated classes and to be able to regenerate these, without loosing any code you've written by hand.
Take a look at how Spring Roo generates domain classes and associated persistence code. In fact, you may also want to use some of the Roo stuff in your code (annotations etc).
Best wishes!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"nav java", please check your private messages for an important administrative matter.
 
naveen velicheti
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Thanks for the reply

This is what I am thinking of using xslt.



in the xslt transformation (if there is some plugin) I can map Hibernate object's corresponding xsd(If I am able to generate them) to jaxb xsds graphically(drag and drop)

and make the data transfer between these two different objects.

Things that are bothering me are converting hibernate objects to xsd and cant find a good free plugin for xslt in eclipse.

Tell me if I am thinking in right way

Thanks in advance
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!