cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gelo1234 <gelo1...@gmail.com>
Subject Re: URLResponse from Restcontroller with Hibernate circular relationships
Date Tue, 04 Mar 2014 22:00:15 GMT
Hi

Can you debug where exactly a problem with circular references exists ?
Is it during serialization of your data ? StringTemplate? IOUtils?

Many serialization techniques/libs do have problems with such references,
be it JAXB or GSON. For JAXB you can setup @Transient annotation.

How about a quick fix, that removes one side of relationship in Hibernate
entities making it uni-directional instead of bi-directional e.g. reverse
side ?

Greetings,
Greg



2014-03-04 22:29 GMT+01:00 Yahoo <hansheinrichbraun@yahoo.de>:

> 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 relationships, so when I give the
>>> structure to the URLResponse there are endless StringBuilder calls.Do you
>>> have an idea how to solve this problem.One idea would be to present the
>>> data in an non Hibernate bean without cicular relationships. But may be
>>> there is an opportunity to avoid new beans.
>>>
>>
>> Hi,
>> such problems arise every time JPA (or other persistence frameworks)
>> entities are published (via REST in your case) without any transformation
>> (the DTO pattern): I am afraid there is any cleaner solution than
>> converting your Hibernate entities into something simpler.
>>
>> BTW: which version are you using?
>>
>> Regards.
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Mime
View raw message