/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package inventario.facade;


import inventario.facade.remote.FacturerFacadeRemote;
import inventario.entity.Facturer;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Daniel
 */
@Stateless
public class FacturerFacade implements  FacturerFacadeRemote {
    @PersistenceContext
    private EntityManager em;

    public void create(Facturer facturer) {
        em.persist(facturer);
    }

    public void edit(Facturer facturer) {
        em.merge(facturer);
    }

    public void remove(Facturer facturer) {
        em.remove(em.merge(facturer));
    }

    public Facturer find(Object id) {
        return em.find(Facturer.class, id);
    }

    public List<Facturer> findAll() {
        return em.createQuery("select object(o) from Facturer as o").getResultList();
    }

}
