So far, I was still working with JSF and JPA without DAO. Now I would like to use DAO. But how can I initialize an EntityManager in DAO classes?
public class AdresseHome { @PersistenceContext private EntityManager entityManager; public void persist(Adresse transientInstance) { log.debug("persisting Adresse instance"); try { entityManager.persist(transientInstance); log.debug("persist successful"); } catch (RuntimeException re) { log.error("persist failed", re); throw re; } } }
Do I use Spring or is there a solution that works without Spring?
Thank.
java spring jpa dao jsf
ich-bin-drin Dec 07 '09 at 16:42 2009-12-07 16:42
source share