×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Fabio Clem
Added: May 25, 2017 1:22 PM
Modified: May 25, 2017 1:22 PM
Views: 10
Tags: no tags
Facotory para criar a entity manager de acordo com o nome da persistencia.
  1.     //Cria factory de acordo com o nome dado na persistence
  2.     static EntityManagerFactory emf = Persistence.createEntityManagerFactory("NOME");
  3.  
  4.     public static EntityManager getInstance() {
  5.         return emf.createEntityManager();
  6.     }