/*
 * 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.Varticulosvszonar;

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 VarticulosvszonarFacade extends AbstractFacade<Varticulosvszonar> implements VarticulosvszonarFacadeLocal {
    @PersistenceContext(unitName = "wcosmodasPersistent")
    private EntityManager em;

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

    public VarticulosvszonarFacade() {
        super(Varticulosvszonar.class);
    }

    @Override
    public List<Varticulosvszonar> busquedaPorSucursal(String sucursal) {
        Query q = em.createNamedQuery("Varticulosvszonar.findBySucursalCodigo");
        q.setParameter("sucursalCodigo", sucursal);
        return q.getResultList();
    }

}
