correcao (fixes bug 6062)

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@41716 d1611594-4594-4d17-8e1d-87c2c4800839
master
lucas.taia 2015-02-24 19:14:35 +00:00
parent 786ef5c1ee
commit 1799342c4e
4 changed files with 36 additions and 0 deletions

View File

@ -1,7 +1,11 @@
package com.rjconsultores.ventaboletos.dao;
import java.util.List;
import com.rjconsultores.ventaboletos.entidad.ConexionCtrl;
public interface ConexionCtrlDAO extends GenericDAO<ConexionCtrl, Long> {
public List<ConexionCtrl> buscarConexionesCtrl(Integer origenId, Integer destinoId);
}

View File

@ -1,5 +1,8 @@
package com.rjconsultores.ventaboletos.dao.hibernate;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
@ -16,4 +19,24 @@ public class ConexionCtrlHibernateDAO extends GenericHibernateDAO<ConexionCtrl,
public ConexionCtrlHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
setSessionFactory(factory);
}
@Override
public List<ConexionCtrl> buscarConexionesCtrl(Integer origenId, Integer destinoId) {
StringBuilder sb = new StringBuilder();
sb.append(" from ConexionCtrl ");
sb.append(" where activo = 1 ");
if (origenId != null) {
sb.append(" and origenId = ").append(origenId);
}
if (destinoId != null) {
sb.append(" and destinoId = ").append(destinoId);
}
Query query = getSession().createQuery(sb.toString());
List<ConexionCtrl> list = query.list();
return list;
}
}

View File

@ -1,7 +1,11 @@
package com.rjconsultores.ventaboletos.service;
import java.util.List;
import com.rjconsultores.ventaboletos.entidad.ConexionCtrl;
public interface ConexionCtrlService extends GenericService<ConexionCtrl, Long> {
public List<ConexionCtrl> buscarConexionesCtrl(Integer origenId, Integer destinoId);
}

View File

@ -69,4 +69,9 @@ public class ConexionCtrlServiceImpl implements ConexionCtrlService {
conexionCtrlDAO.actualizacion(entidad);
}
@Override
public List<ConexionCtrl> buscarConexionesCtrl(Integer origenId, Integer destinoId) {
return conexionCtrlDAO.buscarConexionesCtrl(origenId, destinoId);
}
}