All Downloads are FREE. Search and download functionalities are using the official Maven repository.

br.com.andrewribeiro.ribrest.services.orm.EMFactory Maven / Gradle / Ivy

Go to download

Ribrest Framework - A simple Java framework that truly improve your productivity when developing restful based webservices.

There is a newer version: 1.27.0
Show newest version
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();
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy