fixes bug#8441
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@66149 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
56fa62d48e
commit
6951582b55
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.EstacionSitef;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Lucas
|
||||
*
|
||||
*/
|
||||
public interface EstacionSitefDAO extends GenericDAO<EstacionSitef, Integer> {
|
||||
|
||||
EstacionSitef buscar(Empresa empresa, Integer numempresa, Integer numfilial, String numpdv);
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.EstacionSitefDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.EstacionSitef;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Lucas
|
||||
*
|
||||
*/
|
||||
@Repository("estacionSitefDAO")
|
||||
public class EstacionSitefHibernateDAO extends GenericHibernateDAO<EstacionSitef, Integer> implements EstacionSitefDAO {
|
||||
|
||||
@Autowired
|
||||
public EstacionSitefHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public EstacionSitef buscar(Empresa empresa, Integer numempresa, Integer numfilial, String numpdv) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("empresa", empresa));
|
||||
c.add(Restrictions.eq("numempresa", numempresa));
|
||||
c.add(Restrictions.eq("numfilial", numfilial));
|
||||
c.add(Restrictions.eq("numpdv", numpdv));
|
||||
List<EstacionSitef> estacionsSitef = c.list();
|
||||
return estacionsSitef.isEmpty() ? null : estacionsSitef.get(0);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.EstacionSitef;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Lucas
|
||||
*
|
||||
*/
|
||||
public interface EstacionSitefService {
|
||||
|
||||
EstacionSitef buscar(Empresa empresa, Integer numempresa, Integer numfilial, String numpdv);
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.EstacionSitefDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.EstacionSitef;
|
||||
import com.rjconsultores.ventaboletos.service.EstacionSitefService;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Lucas
|
||||
*
|
||||
*/
|
||||
@Service("estacionSitefService")
|
||||
public class EstacionSitefServiceImpl implements EstacionSitefService {
|
||||
|
||||
@Autowired
|
||||
private EstacionSitefDAO estacionSitefDAO;
|
||||
|
||||
@Override
|
||||
public EstacionSitef buscar(Empresa empresa, Integer numempresa, Integer numfilial, String numpdv) {
|
||||
return estacionSitefDAO.buscar(empresa, numempresa, numfilial, numpdv);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue