title: Spring Boot autowiring entitymanager specific to configuration
body: <p>So I have two configurations for <code>default</code> and <code>dev</code> and in each configuration there's a </p>
  
  <pre><code>    @Bean
      @Autowired
      public EntityManager entityManager(EntityManagerFactory entityManagerFactory) {
          return entityManagerFactory.createEntityManager();
      }
  </code></pre>
  
  <p>Now I want in some component to inject the <code>EntityManager</code> like so</p>
  
  <pre><code>@Autowired
  private EntityManager em;
  </code></pre>
  
  <p>but I'm receiving </p>
  
  <pre><code>... required a single bean, but 2 were found:
      - entityManager: defined by method 'entityManager' in class path resource ...
  </code></pre>
  
  <p>Why the <code>EntityManager</code> from default is not injected ???</p>