/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package socius.persistencia;
import javax.persistence.EntityManager;
import javax.persistence.Persistence;
/**
*
* @author Lucas Dillmann <lucas [at] dillmann.com.br>
*/
public class ConexaoBancoFactory {
private static final ConexaoBancoFactory instance = new ConexaoBancoFactory();
private EntityManager em;
private ConexaoBancoFactory() {
}
public static ConexaoBancoFactory getInstance() {
return instance;
}
public EntityManager getEntityManager() {
if (em == null) {
em = Persistence.createEntityManagerFactory("socius").createEntityManager();
}
return em;
}
}