Iam stuck here! any help would be appreciated. (sorry for duplicate the
post :
http://stackoverflow.com/questions/10180282/requestfactory-and-onetomany-association
)
My case is that i have a @OneToMany association on my module.
class Parent{
@OneToMany(
mappedBy="parent"
)
return List<Child> getChilds();
}
class Child{
@ManyToOne
return Parent getParent();
}
The in the client side i want get get the whole object map.
i do this (AsyncDataProvider with a DataGrid as display):
requestContext.getParents().with("childs").fire(new
Receiver<CallbackProxy>() {
@Override
public void onSuccess(CallbackProxy response) {
display.setRowData(range.getStart(),response.getParents());
updateRowCount(response.getCount().intValue(), true);
}
});
My DAO its just querying the whole map.
Criteria criteria = session.createCriteria(Parent.class);
criteria.setFetchMode("childs", FetchMode.JOIN);
criteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
/* we got all the map here on the server side */
Callback callback = new Callback();
callback.setCount(count);
callback.setParents(criteria.list());
return callback;
But i cant get the childs. The list of them are null. Please note iam using
with("childs")
Thank you.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/0J0QrK3tolYJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.