Difference between revisions of "EclipseLink/Examples/JPA/OutsideContainer"

From Eclipsepedia

Jump to: navigation, search

Revision as of 16:51, 16 October 2007

Users may also use the EntityManager API outside the container by creating a EntityManagerFactory for a given persistence unit name and properties map (includes database information etc.)

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