Created
July 2, 2015 20:57
-
-
Save kevinhooke/5e577a882b13ca8ed121 to your computer and use it in GitHub Desktop.
Initialize standalone PersistenceManager for standalone app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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