Suppose you have the following EJB 3 interfaces / classes:
public interface Repository<E> { public void delete(E entity); } public abstract class AbstractRepository<E> implements Repository<E> { public void delete(E entity){
And then another bean that accesses the FooRepository bean:
//... @EJB private FooRepository fooRepository; public void someMethod(Foo foo) { fooRepository.delete(foo); } //...
However, the overriding method is never executed when the FooRepository bean removal method is FooRepository . Instead, only the implementation of the delete method, which is defined in AbstractRepository , is performed.
What am I doing wrong or is it just a limitation of Java / EJB 3 that generics and inheritance don't work well together?
source share