我有我的OrganizationRequestContext接口,效果很好:
@Service(OrganizationDAO.class)
public interface OrganizationRequestContext extends RequestContext
{
Request<OrganizationProxy> findOrganization(Long id);
InstanceRequest<OrganizationProxy, Void> persist();
InstanceRequest<OrganizationProxy, Void> remove();
}
现在我想把最后两个函数放在我自己设计的PersistentRequestContext
中,这样我就可以在客户端代码中对待所有的RequestContexts:
public interface PersistableRequestContext<T extends BaseProxy>
{
InstanceRequest<T, Void> persist();
InstanceRequest<T, Void> remove();
}
...
@Service(OrganizationDAO.class)
public interface OrganizationRequestContext extends RequestContext, PersistentRequestContext<OrganizationProxy>
{
Request<OrganizationProxy> findOrganization(Long id);
}
但验证失败:服务器抱怨
[ERROR] com.activegrade.shared.data.PersistableRequestContext is not a RequestContext
如果我使PersistableRequestContext扩展RequestContext,那么服务器会抱怨它没有链接到任何特定的DAO服务。
有没有办法在我的各种RequestContext接口中扩展除RequestContext
之外的公共接口?
答案 0 :(得分:0)
此问题已在GWT 2.4中修复。谢谢谷歌!
http://code.google.com/p/google-web-toolkit/issues/detail?id=6035