Sorry it has taken me to long to get back to you - been trying to see if there is a neater way around this issue.
First, yes, this is mostly an issue of how RequestFactory works. I saw the issue you filed at http://code.google.com/p/google-web-...detail?id=6967 and that it was closed in favor of the 'started' issue at http://code.google.com/p/google-web-...detail?id=5974. I don't see any active codereviews on this topic, so I am not sure how much attention it is getting - if I have time this weekend, I'll look into what it might take to fix this myself.
If you want to send the load config and load result objects over the wire, the only good solution for now seems to be creating matching proxy and bean types for each object you want to use. Config objects suffer the same basic issue if they wrap other config objects - even the ListLoadConfig will have this issue, as it contains a collection of SortInfo objects, which each must be translated to a SortInfoBean by RF. One can also create subinterfaces of the configs, as well as beans, or one could just send along the data that is able to be translated. In this code sample, I am doing both: creating a value/proxy pair for the load result, and requiring that the load config be taken apart before being sent over the wire:
Code:
public interface PostRequest extends RequestContext {
@ProxyFor(PostPagingLoadResultBean.class)
public interface PostPagingLoadResultProxy extends ValueProxy, PagingLoadResult<PostProxy> {
@Override
public List<PostProxy> getData();
}
public static class PostPagingLoadResultBean extends BasePagingLoadResult<Post> {
public PostPagingLoadResultBean(List<Post> list, int totalLength, int offset) {
super(list, totalLength, offset);
}
}
Request<PostPagingLoadResultProxy> getPosts(int offset, int limit, List<? extends SortInfo> sortInfo);
}
> and... how have you implemented code generation of BasePagingLoadResult?
Can you explain this comment? I don't understand.