Thanks but it not solves it yet...
You showed an example for DAO interface inheritance.
If I apply this example and also make my SuperItemDaoImpl to extend ItemDaoImpl and implement the SuperItemDao interface, then I get a compilation error:
Quote:
The interface IGenericDao cannot be implemented more than once with different arguments: IGenericDao<Item,Long> and IGenericDao<SuperItem,Long>
The code:
Code:
public interface IGenericDao<T, ID extends Serializable> {
public T doSomethingGeneric(ID id);
}
public interface IItemDao<T extends Item> extends IGenericDao<T, Long>{
public T doSomethingItem(Long id);
}
public interface ISuperItemDao<T extends SuperItem> extends IGenericDao<T, Long>{
public SuperItem doSomethingMoreSuperItem(Long id);
}
public class GenericDao<T, ID extends Serializable> implements IGenericDao<T, ID> {
public T doSomethingGeneric(ID id) {
...
}
}
public class ItemDao extends GenericDao<Item, Long> implements IItemDao<Item>{
public Item doSomethingItem(Long id) {
...
}
}
public class SuperItemDao extends ItemDao implements ISuperItemDao<SuperItem>{
public SuperItem doSomethingMoreSuperItem(Long id) {
...
}
}
public class SuperItemDao extends ItemDao implements ISuperItemDao<SuperItem>{
the red color is the compilation error.