-
1. Re: EntityManager lookUp in generics POJO
epbernard Dec 30, 2005 9:13 PM (in response to sventevith)no.
But what's wrong with having an EJB3 doing the DAO layer? -
2. Re: EntityManager lookUp in generics POJO
jhotter Jan 6, 2006 10:44 AM (in response to sventevith)hey, I have the similar question, how to get the another session bean by the session bean already got the client, which is a generic POJO ?
-
3. Should be possible ...
bjb Jan 6, 2006 11:36 AM (in response to sventevith)As §5.3.2 of the EJB 3.0 PFD
In any SE environment you can do :
EntityManagerFactory emf =
javax.persistence.Persistence.createEntityManagerFactory("YourFactory");
EntityManager em = emf.createEntityManager();
Did you already tried that ?
As a POJO unmanaged is a SE, as long as the persistence.xml is configured it should work ...
Anyway, I do not see also what's wrong with EJB3 the DAO ;-)
Rgs,
JB -
4. Re: EntityManager lookUp in generics POJO
jefmsmit Jan 19, 2006 7:17 PM (in response to sventevith)I have a similar problem because I need an EntityManager in a custom hibernate validator class. It sure would be nice if I could just dependency inject it, but for now I'll just look it up in JNDI (the old fashioned way).