title: Inject PersistenceContext with CDI
body: <p>Currently, I'm using PersistenceContext to inject an EntityManager. The EM is injected perfectly.</p>
  
  <pre><code>@Stateless
  public StatelessSessionBean implements StatelessSessionBeanLocal {
  
      @PersistenceContext(unitName = "MyPersistenceUnit")
      private EntityManager em;
  
      @Override
      public Collection&lt;MyObject&gt; getAllObjects(){
          CriteriaBuilder cb = em.getCriteriaBuilder();
          CriteriqQuery&lt;MyObject&gt; query = cb.createQuery(MyObject.class);
          query.from(MyObject);
          return em.createQuery(query).getResultList();
      }
  }
  </code></pre>
  
  <p>Now I try to decorate the bean, and suddenly the em doesn't get injected. I get a NullPointerException.</p>
  
  <pre><code>@Decorator
  public StatelessSessionBeanDecorator implements StatelessSessionBeanLocal {
  
      @Inject
      @Delegate
      @Any
      StatelessSessionBeanLocal sb
  
      @Override
      public Collection&lt;MyObject&gt; getAllObjects(){
          System.out.println("Decorated method!");
          return sb.getAllObjects();
      }
  }
  </code></pre>
  
  <p>I know EJB and CDI are 2 completely different managers, so the one doesn't know about the other. I'm expecting that @PersistenceContext is an EJB injection point, while @Inject is a CDI one. What should I do to solve this and get the EntityManager to be injected like it should?</p>