title: How autowired bean based generic value in spring?
body: <p>I have the following code structure </p>
  
  <pre><code>@Component
  public class MyServiceUser{
      @Autowired
      private MyService&lt;FirstMyDao&gt; dao;
  
  }
  
  @Service
  public class MyService&lt;T extends AbstractMyDao&gt;{
  
      @Autowired
      private T myDao;
  }
  
  abstract class AbstractMyDao{}
  @Repository
  class FirstMyDao extends AbstractMyDao{}
  
  @Repository
  class SecondMyDao extends AbstractMyDao{}
  </code></pre>
  
  <p>Spring said that he can't resolve which type of dao set in service. Can I do it? 
  I read a few articles but didn't find the answer(<a href="https://blog.jayway.com/2013/11/03/spring-and-autowiring-of-generic-types/" rel="nofollow noreferrer">https://blog.jayway.com/2013/11/03/spring-and-autowiring-of-generic-types/</a> , <a href="https://stackoverflow.com/questions/22603291/how-to-autowire-bean-of-generic-type-t-in-spring">How to Autowire Bean of generic type &lt;T&gt; in Spring?</a>). </p>