1 Reply Latest reply on Sep 30, 2005 6:38 AM by epbernard

    EntityManager in Entity Bean in EJB 3.0

    gdellelce

      Can I inject an EntityManager in an EntityBean in EJB 3.0?

      I use JAG (Java Application Generator: http://jag.sourceforge.net/) to generate my application from an existent DB.

      In the generated Entity Bean I found something like:

      @Inject EntityManager manager;

      after I changed @Inject with @PersistenceContext I was able to
      compile and deploy the Beans on JBoss 4.0.2 and EJB3.0 rc2,
      but in the debugger I noticed that the field manager is always
      null in EntityBeans.

      THANK YOU
      Gianfranco