GWT RequestFactory: interface inheritance in RequestContext

I have an OrganizationRequestContext interface that works fine:

@Service(OrganizationDAO.class)
public interface OrganizationRequestContext extends RequestContext
{
    Request<OrganizationProxy> findOrganization(Long id);

    InstanceRequest<OrganizationProxy, Void> persist();
    InstanceRequest<OrganizationProxy, Void> remove();
}

Now I want to take these last two functions and put them in PersistentRequestContextmy own design so that I can handle all my RequestContexts the same in my client code:

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);
}

But this does not allow checking: the server complains that

[ERROR] com.activegrade.shared.data.PersistableRequestContext is not a RequestContext

If I force PersistableRequestContext to extend RequestContext, then the server complains that it is not associated with any specific DAO service.

Is there a way to extend the common interface besides RequestContextin my various RequestContext interfaces?

+3
source share
1 answer

This issue has been fixed in GWT 2.4. Thanks Google!

http://code.google.com/p/google-web-toolkit/issues/detail?id=6035

0

Source: https://habr.com/ru/post/1792643/


All Articles