Skip to content

Instantly share code, notes, and snippets.

@kevinhooke
Created July 2, 2015 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinhooke/5e577a882b13ca8ed121 to your computer and use it in GitHub Desktop.
Save kevinhooke/5e577a882b13ca8ed121 to your computer and use it in GitHub Desktop.
Initialize standalone PersistenceManager for standalone app
EntityManagerFactory emf = Persistence.createEntityManagerFactory("TestPU");
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
em.persist(exampleEntity);
em.getTransaction().commit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment