We are developing a web application with Spring, Hibernate and Maven in a very modular fashion. There are core projects defining data access and view specific stuff, then th
We use a similar module layout, but we place the persistence context in the war-part of our application and inject the entitymanager into the DAOs of the modules. Except for unit testing, the modules don't have a PU. We did this because we were afraid, that a transaction spanning multiple modules could cause trouble.
In the DAO
@PersistenceContext
private EntityManager em;
In the persistance.xml you need to enlist all entities with the elements.
com.Entity1
com.Entity2
etc.