GWT RequestFactory 返回错误类型的对象

发布于 2024-12-28 12:15:56 字数 2143 浏览 1 评论 0原文

当我调用获取 TripImportSummaryProxy 对象列表时,我得到以下列表: com.schedgy.core.dao.filter.proxy.FilterProxyAutoBean_com_google_web_bindery_requestfactory_shared_impl_EntityProxyCategory_com_google_web_bindery_requestfactory_shared_impl_ValueProxyCategory_com_google_web_bindery_requestfactory_shared_impl_BaseProxyCategory

@ProxyFor(value=TripImportSummary.class, locator=TripImportSummaryLocator.class)
public interface TripImportSummaryProxy extends MyBaseProxy {
    // some setter/getters defined here
}

public interface TripImportSummaryRequestFactory extends RequestFactory, HasPaginationRequest<TripImportSummaryProxy> {
    TripImportSummaryRequest request();
}

@Service(value=TripImportSummaryService.class, locator=MyServiceLocator.class)
public interface TripImportSummaryRequest extends RequestContext, PaginationRequest<TripImportSummaryProxy> {

}

@SkipInterfaceValidation
public interface HasPaginationRequest<T> extends RequestFactory {
    PaginationRequest<T> request();
}

@ExtraTypes(FilterProxy.class)
@SkipInterfaceValidation
public interface PaginationRequest<T> extends RequestContext {

    Request<List<T>> paginate(int offset, int limit, String sortColumn,
            boolean isSortAscending, List<FilterProxy> filters);

    Request<Integer> count(List<FilterProxy> list);
}

这都是通过以下方式执行的:

PaginationRequest<TripImportSummaryProxy> request = requestFactory.request();
request.paginate(offset, limit, sortColumn, isSortAscending, getFilters(request)).with(getPaths()).fire(new MyReceiver<List<TripImportSummaryProxy>>() {

    @Override
    public void onSuccess(List<TripImportSummaryProxy> response) {
        // Response is a list of type that seems to extend from FilterProxy
    }
});

FilterProxy 只是各种过滤器接口扩展的标记接口。

@ProxyFor(Object.class)
public interface FilterProxy extends ValueProxy {

}

我还有大约两打其他请求正在工作,但唯一失败的是这个。我已验证服务器端服务是否正确获取并返回正确的数据。我发现 TripImportSummaryLocator 类从未实例化,即使它似乎正确绑定到代理类型并且具有默认构造函数。

When I make a call to fetch a list of TripImportSummaryProxy objects, I get back a list of:
com.schedgy.core.dao.filter.proxy.FilterProxyAutoBean_com_google_web_bindery_requestfactory_shared_impl_EntityProxyCategory_com_google_web_bindery_requestfactory_shared_impl_ValueProxyCategory_com_google_web_bindery_requestfactory_shared_impl_BaseProxyCategory.

@ProxyFor(value=TripImportSummary.class, locator=TripImportSummaryLocator.class)
public interface TripImportSummaryProxy extends MyBaseProxy {
    // some setter/getters defined here
}

public interface TripImportSummaryRequestFactory extends RequestFactory, HasPaginationRequest<TripImportSummaryProxy> {
    TripImportSummaryRequest request();
}

@Service(value=TripImportSummaryService.class, locator=MyServiceLocator.class)
public interface TripImportSummaryRequest extends RequestContext, PaginationRequest<TripImportSummaryProxy> {

}

@SkipInterfaceValidation
public interface HasPaginationRequest<T> extends RequestFactory {
    PaginationRequest<T> request();
}

@ExtraTypes(FilterProxy.class)
@SkipInterfaceValidation
public interface PaginationRequest<T> extends RequestContext {

    Request<List<T>> paginate(int offset, int limit, String sortColumn,
            boolean isSortAscending, List<FilterProxy> filters);

    Request<Integer> count(List<FilterProxy> list);
}

This is all executed via:

PaginationRequest<TripImportSummaryProxy> request = requestFactory.request();
request.paginate(offset, limit, sortColumn, isSortAscending, getFilters(request)).with(getPaths()).fire(new MyReceiver<List<TripImportSummaryProxy>>() {

    @Override
    public void onSuccess(List<TripImportSummaryProxy> response) {
        // Response is a list of type that seems to extend from FilterProxy
    }
});

FilterProxy is just a marker interface that various filter interfaces extend.

@ProxyFor(Object.class)
public interface FilterProxy extends ValueProxy {

}

I have about two dozen other requests working and its only failing on this one. I have verified that the server side service is correctly fetching and returning the right data. I have found that the TripImportSummaryLocator class is never instantiated even though it appears to be bound to the proxy type correctly and has a default constructor.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一张白纸 2025-01-04 12:15:56

我使用的是 GWT 2.4 rc1,升级到 GWT 2.4 stable 后,我不再看到这个问题。

I was using GWT 2.4 rc1 and after upgrading to GWT 2.4 stable I am no longer seeing this problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文