diff --git a/src/com/rjconsultores/ventaboletos/dao/CorridaDAO.java b/src/com/rjconsultores/ventaboletos/dao/CorridaDAO.java index a50b77ca6..efbe53283 100644 --- a/src/com/rjconsultores/ventaboletos/dao/CorridaDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/CorridaDAO.java @@ -102,5 +102,7 @@ public interface CorridaDAO extends GenericDAO { public Integer atualizaCorridasIntegracaoTotvs(Marca marca, Date dataIncial, Date dataFinal, Integer corridaId) throws BusinessException; public List buscarListaPorIds(List corridaIds); + + public CorridaVO buscarVOPorId(Id corridaId); } \ No newline at end of file diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaHibernateDAO.java index 3a1100692..636a34fbf 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CorridaHibernateDAO.java @@ -910,30 +910,19 @@ public class CorridaHibernateDAO extends GenericHibernateDAO buscarListaPorIds(List corridaIds){ - String hql = " select co " - + " from Corrida co" - + " where co.activo = 1 " - + " and co.id in ( :corridaIds )"; + StringBuilder hql = new StringBuilder(); + hql.append(" select co ") + .append(" from Corrida co") + .append(" where co.activo = 1 ") + .append(" and co.id in ( :corridaIds )"); - Query query = getSession().createQuery(hql); + Query query = getSession().createQuery(hql.toString()); query.setParameterList("corridaIds", corridaIds); List lsCorridas = query.list(); List listCorrida = new ArrayList(); for (Corrida corrida : lsCorridas) { - CorridaVO co = new CorridaVO(); - co.setCorridaId(corrida.getId().getCorridaId()); - co.setFeccorrida( DateUtil.getStringDate( corrida.getId().getFeccorrida())); - co.setNumCorrida(corrida.getId().getCorridaId()); - co.setFechorsalida( DateUtil.getStringDate(corrida.getFechorsalida(), "dd/MM/yyyy HH:mm:ss.SSS") ); - co.setOrigenId(corrida.getOrigem().getParadaId()); - co.setDestinoId(corrida.getDestino().getParadaId()); - co.setTipoServicioId(corrida.getTipoServicio().intValue()); - co.setRolOperativoId(corrida.getRolOperativo().getRoloperativoId()); - co.setMarcaId( corrida.getMarca().getMarcaId().intValue() ); - co.setClaseServicioId( corrida.getClaseServicio().getClaseservicioId()); - co.setEmpresaId( corrida.getEmpresa().getEmpresaId()); - co.setRutaId( corrida.getRuta().getRutaId() ); + CorridaVO co = new CorridaVO(corrida); preencherTramoSequencia(co, corrida); @@ -943,6 +932,14 @@ public class CorridaHibernateDAO extends GenericHibernateDAO