Hi, I'm using spring + hibernate 3 and maybe i have not understood very well how to use hibernate4gwt;
I followed the stateless approach and all works fine, but I have some doubt with lazy properties.
A simple scenario:
class User
class Bid.
User has a name (String) and a collection of Bid (lazy fetch).
My userDAO returns User objects, but calling getBids() I have null.
I thought that, when used, being a lazy property, hibernate4GWT could manage the retrieve.
It is wrong?
If wrong, how I can obtain that? (without sending the entire graph all at once)?
thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Indeed, Hibernate4GWT replaces lazy properties with null on client side and does not implement a remote lazy loading mechanism (even if it is technically possible, I always thought that it would lead to very poor performances).
So the behavior you describe is normal.
If you want your bids separately, you have to load them with specific DAO method, and send the list to GWT before setting it to User.
HTH
Bruno
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I'm using spring + hibernate 3 and maybe i have not understood very well how to use hibernate4gwt;
I followed the stateless approach and all works fine, but I have some doubt with lazy properties.
A simple scenario:
class User
class Bid.
User has a name (String) and a collection of Bid (lazy fetch).
My userDAO returns User objects, but calling getBids() I have null.
I thought that, when used, being a lazy property, hibernate4GWT could manage the retrieve.
It is wrong?
If wrong, how I can obtain that? (without sending the entire graph all at once)?
thanks
Hi,
Indeed, Hibernate4GWT replaces lazy properties with null on client side and does not implement a remote lazy loading mechanism (even if it is technically possible, I always thought that it would lead to very poor performances).
So the behavior you describe is normal.
If you want your bids separately, you have to load them with specific DAO method, and send the list to GWT before setting it to User.
HTH
Bruno
i have 2 entity
MessageEntity
private Integer id
private User user
....
UserEntity
private Integer id
private String name
using gxt my grid has a list of MessageEntity
in column I set user.name... but return "" because User is null..
Soluction: "you have to load them with specific DAO method, and send the list to GWT before setting it to User. "
dont have other soluction?
you can post an example of how I can use LazyKiller