Here is a class I have :
public class ProxyDAO<T extends DAO<? extends Model>> implements DAO<? extends Model> {
...
}
The compiler complains that A supertype may not implement a wildcard.
I have tried this:
public class ProxyDAO<T extends DAO<? extends Model>> implements DAO<Model> {
...
}
But subclasses of Model are now not allowed.
How can I tell the compiler that ProxyDAO implements the DAO interface and that this interface would be accept a Model class or any subclasses or Model ?
DAO.java
public interface DAO<T extends Model> {
T findByPK(Object pk);
}
Use the following:
And if you need to allow for supclasses of DAO: