• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JAXB persistency

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic