br.com.andrewribeiro.ribrest.services.orm.EMFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Ribrest Show documentation
Show all versions of Ribrest Show documentation
Ribrest Framework - A simple Java framework that truly improve your productivity when developing restful based webservices.
package br.com.andrewribeiro.ribrest.services.orm;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import org.glassfish.hk2.api.Factory;
/**
*
* @author Andrew Ribeiro
*/
public class EMFactory implements Factory{
@Inject
EMFFactory emf;
@Override
public EntityManager provide() {
return emf.provide().createEntityManager();
}
@Override
public void dispose(EntityManager t) {
t.close();
}
}