correcao (fixes bug 6062)
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@41716 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
786ef5c1ee
commit
1799342c4e
|
@ -1,7 +1,11 @@
|
||||||
package com.rjconsultores.ventaboletos.dao;
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.ConexionCtrl;
|
import com.rjconsultores.ventaboletos.entidad.ConexionCtrl;
|
||||||
|
|
||||||
public interface ConexionCtrlDAO extends GenericDAO<ConexionCtrl, Long> {
|
public interface ConexionCtrlDAO extends GenericDAO<ConexionCtrl, Long> {
|
||||||
|
|
||||||
|
public List<ConexionCtrl> buscarConexionesCtrl(Integer origenId, Integer destinoId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.hibernate.Query;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
@ -16,4 +19,24 @@ public class ConexionCtrlHibernateDAO extends GenericHibernateDAO<ConexionCtrl,
|
||||||
public ConexionCtrlHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
public ConexionCtrlHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
setSessionFactory(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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
package com.rjconsultores.ventaboletos.service;
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.ConexionCtrl;
|
import com.rjconsultores.ventaboletos.entidad.ConexionCtrl;
|
||||||
|
|
||||||
public interface ConexionCtrlService extends GenericService<ConexionCtrl, Long> {
|
public interface ConexionCtrlService extends GenericService<ConexionCtrl, Long> {
|
||||||
|
|
||||||
|
public List<ConexionCtrl> buscarConexionesCtrl(Integer origenId, Integer destinoId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,4 +69,9 @@ public class ConexionCtrlServiceImpl implements ConexionCtrlService {
|
||||||
|
|
||||||
conexionCtrlDAO.actualizacion(entidad);
|
conexionCtrlDAO.actualizacion(entidad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ConexionCtrl> buscarConexionesCtrl(Integer origenId, Integer destinoId) {
|
||||||
|
return conexionCtrlDAO.buscarConexionesCtrl(origenId, destinoId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue