EclipseLink/Examples/JPA/OutsideContainer

From Eclipsepedia

Jump to: navigation, search

Users may also use the EntityManager API outside the container.

Using a persistence unit name

EntityManagerFactory emf = Persistence.createEntityManagerFactory(persistenceUnitName, propertiesMap);
EntityManager em = emf.createEntityManager();