Hi,
I'm working on a EJB 3.0 + Hibernate project.
I've decided to use an application managed EntityManager instead of a container managed EntityManagaer.
I'm creating the EntityManager using an EntityManagerFactory and in another class, I'm using @PersistenceUnit(name="myName") to try and inject the EntityManager I've created into an EntityManager class member (The persistence unit is defined in persistence.xml).
The problem is that the injection doesn't work and I get a null value.
I'm assuming that I can use entity injection by using @PersistenceUnit even without a container?
Any ideas what I'm doing wrong?
|