I had an issue to autowire an object in my abstract base class. It always give me null instead of an instance. Please help.
Base class:
public abstract class BaseClass implements IReq<Req> {
@Autowired
protected ReqDao dao;
protected void updateReq() {
dao.update();
}
}
Child class:
@Component
public class ChildClass extends BaseClass {
...
}
ReqDao class:
@Component
public class RptRequestDao {
public void update(){
...
}
}
I am thinking of simply use the update() function in Base class, which means in my ChildClass, I don't override that one. Is this the problem? If it is, what's the normal way to do it? Thanks in advance.