Hi,
I've got some generic class for my JPA model POJO that goes like this:
public interface Identifiable<PK extends Serializable> {
PK getUniqueId();
}
public interface GenericDao<T extends Identifiable<PK>> {
public T findById(PK id);
}
This code won't compile. For this to work, I need to specify
public interface GenericDao<T extends Identifiable<PK>, PK extends Serializable>
But that's redundant information !! The fact that T extends Identifiable imply that a PK type will be specified for the Identifiable instance and that this is the type to use for the DAO's PK.
How can I make this work without redundant information ?
Thanks, Fred
Edit: Simplified example