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?
source
share