Web services and hibernate - how would you combine these two?
I would like to use hibernate for persisting objects through web services and am thinking of using hyperjaxb3 with Apache CXF. Do you have any other suggestion for this purpose?
Edit: To clarify my question a little bit... I am using eclipse and wsgen, wsimport ant tasks to generate my service and client classes respectively. I am using annotations to configure entities which are persisted by hibernate. With this setting I encountered a few simple issues which I was able to fix by googling around. Then I encountered a problem with cyclic references which I fixed with afterUnmarshal (described here ). Afterwards I encountered a problem of entity with two parents (two bidirectional relationships) which I tried to solve with @XmlID and @XmlIDREF in the way described here but didn'开发者_开发百科t make it in the end. And at that time I began to wonder if I am doing something wrong and should use different tools/technologies (should I maybe switch to maven, or introduce spring, etc.) so I investigated a little bit and found out about hyperjaxb3 and am wondering if that could be the solution to my problems? :)
Edit 2: In short, which way you use, prefer or just do in most cases involving these two?
EclipseLink JAXB (MOXy) has extensions for handling JPA entities, for more information see:
- http://wiki.eclipse.org/EclipseLink/Examples/MOXy/JPA
Take a look the Spring MVC Tutorial, which you'd be able to integrate with Hibernate quite easily.
精彩评论