title: Autowire depending upon the subclass
body: <p>I have a abstract class <code>AbstractService</code> which has a reference to <code>AbstractDAO</code></p>
  
  <pre><code>class AbstractService{  
     protected AbstractDAO abstractDAO;  
  }
  </code></pre>
  
  <p><code>AbstractService</code> will be extended by actual service classes like <code>ServiceClassA</code> , <code>ServiceClassB</code> etc,
  and <code>AbstractDAO</code> will be extended by <code>DaoClassA</code> , <code>DaoClassB</code> etc.</p>
  
  <p>Depending upon which class is extending <code>AbstractService</code>, <code>abstractDAO</code> should be an instance of <code>DaoClassA</code> , <code>DaoClassB</code> etc</p>
  
  <p>I can achieve this by having the abstractDAO setter in the extending class like</p>
  
  <pre><code>class ServiceClassA{    
      @Autowired  
      @Qualifier("daoClassA")  
      public void setAbstractDAO(AbstractDAO abstractDAO) {  
          super.abstractDAO = abstractDAO;  
      }   
  }  
  </code></pre>
  
  <p>Is there any way to have the setter <code>setAbstractDAO</code> in <code>AbstractService</code> class itself
  and <code>abstractDAO</code> gets Autowired depending upon the subclass maybe wth SPEL+Qualifier etc</p>
  
  <p>We dont want to use any XML configuration for this</p>