This content has been marked as final.
Show 3 replies
-
1. Re: Using EntityManager in Hibernate Validator
nickarls Aug 10, 2007 2:45 AM (in response to csl)Just guessing here but can you get the EntityManagerFactory from JNDI?
-
2. Re: Using EntityManager in Hibernate Validator
csl Aug 10, 2007 3:33 AM (in response to csl)Yes, this works.
Context ctx = new InitialContext(); EntityManagerFactory entityManagerFactory = (EntityManagerFactory) ctxlookup("java:/myprojectEntityManagerFactory"); entityManager = entityManagerFactory.createEntityManager();
But isn't there a better way to do this? It would be great if I could obtain Seam components (e.g. Log). -
3. Re: Using EntityManager in Hibernate Validator
pmuir Aug 10, 2007 5:35 AM (in response to csl)Hibernate Validators are not Seam components and don't fall within the Seam lifecycle hence you can't do injection in there.