Re: URLResponse from Restcontroller with Hibernate circular relationships

2014-03-04 Thread Yahoo
I am using Hibernate 4.1.8-Final and cocoon 3.0.0-beta-1-SNAPSHOT. But why you ask? Am 03.03.2014 08:09, schrieb Francesco Chicchiriccò: On 03/03/2014 04:36, Yahoo wrote: I am using cocoon RestController to present my Hibernate Mysql data in pdf files. The Hibernate structure has cirular

Re: URLResponse from Restcontroller with Hibernate circular relationships

2014-03-04 Thread gelo1234
Another kind of hack (if you cannot modify entity sources and they are not external .xml files) would be setting all child objects' parent references to null _before_ serializing that data. Lets say you got: Author and Book entites with One-To-Many relationship. You retrieve the entities from db

Re: URLResponse from Restcontroller with Hibernate circular relationships

2014-03-04 Thread Yahoo
Thanks Greg,That's the idea as long as I don't save the bean there is no problem with the database. And such methods I already use with Lazy loading between two requests. Am 04.03.2014 23:47, schrieb gelo1234: Another kind of hack (if you cannot modify entity sources and they are not

Re: URLResponse from Restcontroller with Hibernate circular relationships

2014-03-04 Thread gelo1234
Yup, Lazy loading will cause problems in this scenario. How about making Hibernate session readOnly ? :) http://stackoverflow.com/questions/5800814/is-it-possible-to-detach-hibernate-entity-so-that-changes-to-object-are-not-aut Greetings, Greg 2014-03-05 4:52 GMT+01:00 Yahoo