title: Migrating CDI/EJB annotations to Spring annotations
body: <p>I'm trying to replace my CDI/EJB annotations with Spring ones. But I'm struggeling how to do it right.</p>
  
  <p>This is what I have in CDI/EJB:</p>
  
  <pre><code>@Stateless
  @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
  class Service {
      @Inject
      EntityManager em;
  }
  
  
  @Named
  @RequestScoped
  class Facade {
      @Inject
      Service service;
  }
  </code></pre>
  
  <p>Now I would do the following:</p>
  
  <pre><code>@Stateless
  @Transactional
  @Repository
  class Service {
      @Inject
      EntityManager em;   
  }
  </code></pre>
  
  <p>What about the stateless? What is the aquivalent in spring?
  Obvious I cannot just remove this annotation, bc then I'm getting these exception:</p>
  
  <pre><code>javax.el.PropertyNotFoundException: /input.xhtml @15,30 registerButtonAction="#{facade.createNew()}": The class 'Facade$Proxy$_$$_WeldClientProxy' does not have the property ...
  </code></pre>
  
  <p>Further:</p>
  
  <pre><code>@Named
  @Service
  class Facade {
      @Autowired
      Service service;
  }
  </code></pre>
  
  <p>Do I have to simply replace all <code>@Inject</code> annotations with <code>@Autowired</code>?
  Is there something in Spring that takes care of EL naming, so that I can remove the <code>@Named</code>?</p>
  
  <p>Do I have to annotate my JPA entities too?</p>