Re: Request Factory Entity Relationships Lazy Loading

2010-11-18 Thread koma
IMO, this problem is not really GWT related but standard hibernate/jpa behaviour. Either you define your relationships as lazy, which means that they are not loaded when the parent object is loaded, or you define the relations as eager fetch. The best practice is lazy load and then load the needed

Re: Request Factory Entity Relationships Lazy Loading

2010-11-18 Thread PJ Herring
The problem with this is you will end up writing a lot of code to get the whole object back. It makes a complex Data Access layer and makes me wonder is it worth using a relational database. If I have to fetch relationships separately (in either layer) why not use a key store database. On Nov 18,

Re: Request Factory Entity Relationships Lazy Loading

2010-11-18 Thread Thomas Broyer
On 18 nov, 08:47, agi 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

Re: Request Factory Entity Relationships Lazy Loading

2010-11-17 Thread agi
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 entityManag

Request Factory Entity Relationships Lazy Loading

2010-11-17 Thread PJ Herring
So I've been working on this problem with RequestFactory and Lazy Loading. I am using a Service Layer to deal with operations on Domain Objects. I ran into a problem when I was trying to "merge" an object with my Hibernate Domain layer. Hibernate was throwing a "lazy loading" error ("Failed to lazi