/*
 * 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.Articulo;
import com.cosmodas.EntCosmos.ArticulosZonasTotal;

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

/**
 * @author obper
 */
@Stateless
public class ArticulosZonasTotalFacade extends AbstractFacade<ArticulosZonasTotal> implements ArticulosZonasTotalFacadeLocal {
    @PersistenceContext(unitName = "wcosmodasPersistent")
    private EntityManager em;

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

    public ArticulosZonasTotalFacade() {
        super(ArticulosZonasTotal.class);
    }

    @Override
    public List<ArticulosZonasTotal> busquedaSucursalArticuloCodigo(Integer sucursal, Articulo articulo) {

        Query q = em.createNamedQuery("ArticulosZonasTotal.findBySucursalAndArticuloCodigo");
        q.setParameter("sucursalCodigo", sucursal);
        q.setParameter("articuloCodigo", articulo);
        return q.getResultList();
    }


}
