/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cosmodas.FacadeCosmos;

import com.cosmodas.EntCosmos.VReporterecibos;

import java.util.Date;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 * @author obper
 */
@Stateless
public class VReporterecibosFacade extends AbstractFacade<VReporterecibos> implements VReporterecibosFacadeLocal {

    @PersistenceContext(unitName = "wcosmodasPersistent")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public VReporterecibosFacade() {
        super(VReporterecibos.class);
    }

    @Override
    public List<VReporterecibos> ObtenerReportes(String tipoRec, Date fecha) {

        List<VReporterecibos> lsR = em.createNativeQuery("{CALL reporte_recibos_p(?,?)}",
                VReporterecibos.class)
                .setParameter(1, tipoRec)
                .setParameter(2, fecha).getResultList();
        return lsR;
    }


}
