Created
March 9, 2023 14:21
-
-
Save vitorgonzaga/824dcf0154415c10670087673c957ab7 to your computer and use it in GitHub Desktop.
JPAUtil.java
This file contains hidden or 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
package br.com.alura.loja.util; | |
import javax.persistence.EntityManager; | |
import javax.persistence.EntityManagerFactory; | |
import javax.persistence.Persistence; | |
public class JPAUtil { | |
private static final EntityManagerFactory FACTORY = Persistence.createEntityManagerFactory("loja"); | |
public static EntityManager getEntityManager() { | |
return FACTORY.createEntityManager(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment