Announcement Announcement Module
No announcement yet.
Spring property loading depending on class that invokes Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring property loading depending on class that invokes

    I have a abstract class AbstractService which has a reference to AbstractDAO

    class AbstractService{
    protected AbstractDAO abstractDAO;
    AbstractService will be extended by actual service classes like ServiceClassA , ServiceClassB etc, and AbstractDAO will be extended by DaoClassA , DaoClassB etc.

    Depending upon which class is extending AbstractService, abstractDAO should be an instance of DaoClassA , DaoClassB etc

    I can achieve this by having the abstractDAO setter in the extending class like

    class ServiceClassA{
    public void setAbstractDAO(AbstractDAO abstractDAO) {
    super.abstractDAO = abstractDAO;

    Is there any way to have the setter setAbstractDAO in AbstractService class itself and abstractDAO gets Autowired depending upon the subclass maybe wth SPEL+Qualifier etc

    We dont want to use any XML configuration for this

    Thanks in Advance