On 18 nov, 08:47, agi <
agata.p...@gmail.com> wrote:
> Hi
>
> I had this problem as well. I haven't found perfect solution.. What I
> have done is while retrieving data from the database so e.g. in
> findEntity(Long id) method I am forcing persistent layer to return my
> collection immediately:
> Entity findEntity(Long id)
> {
> // open transaction, get entityManager etc.
> // ...
>
> Entity obj = entityManager.find(id);
>
> // force retrival of collection
> obj.getDonations().size();
>
> // handle transaction and entitymanager etc.
> //...
>
> }
>
> I will be very glad to find out how to make it in a better way:)