diff --git a/pom.xml b/pom.xml
index fa8d31267..9afa6c73e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
br.com.rjconsultores
ModelWeb
- 1.32.0
+ 1.32.1
diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaHibernateDAO.java
index cfa9437e9..109c9236b 100644
--- a/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaHibernateDAO.java
+++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/TarifaHibernateDAO.java
@@ -283,11 +283,12 @@ public class TarifaHibernateDAO extends GenericHibernateDAO imp
public void excluirTodasTarifas(Moneda moneda, Marca marca, ClaseServicio claseServicio, VigenciaTarifa vigenciaTarifa, Parada origem,
Parada destino, Categoria categoria, TipoPuntoVenta tipoPuntoVenta, Ruta ruta, Via via, Boolean vende, Integer usuarioModifId) {
StringBuilder hql = new StringBuilder();
- hql.append(" update Tarifa set activo = 0, fecmodif = sysdate(), usuarioId = ").append(usuarioModifId).append(" where tarifaId in (");
- hql.append(" select t.tarifaId from Tarifa t ");
+ try {
+ hql.append(" update Tarifa tb set activo = 0, fecmodif = sysdate(), usuarioId = ").append(usuarioModifId).append(" where tarifaId in (");
+ hql.append(" select tb.tarifaId from Tarifa t ");
if (vende != null) {
- hql.append(" inner join t.ruta.rutaCombinacionList AS rutaCombinacionList" );
+ hql.append(" inner join tb.ruta.rutaCombinacionList AS rutaCombinacionList" );
}
if (categoria == null && tipoPuntoVenta == null) {
@@ -295,12 +296,12 @@ public class TarifaHibernateDAO extends GenericHibernateDAO imp
}
if (categoria != null) {
- hql.append(" inner join t.lsTarifaCategoria as tarifascategoria ");
+ hql.append(" inner join tb.lsTarifaCategoria as tarifascategoria ");
hql.append(" where 0 = 0 and tarifascategoria.categoria.categoriaId = " + categoria.getCategoriaId());
}
if (tipoPuntoVenta != null) {
- hql.append(" inner join t.lsTarifaTipoptovta as tarifastipoptovta ");
+ hql.append(" inner join tb.lsTarifaTipoptovta as tarifastipoptovta ");
if (categoria == null) {
hql.append(" where 0 = 0 and tarifastipoptovta.tipoPuntoVenta.tipoptovtaId = " + tipoPuntoVenta.getTipoptovtaId());
} else {
@@ -309,35 +310,35 @@ public class TarifaHibernateDAO extends GenericHibernateDAO imp
}
if (moneda != null) {
- hql.append(" and t.moneda.monedaId = " + moneda.getMonedaId());
+ hql.append(" and tb.moneda.monedaId = " + moneda.getMonedaId());
}
if (marca != null) {
- hql.append(" and t.marca.marcaId = " + marca.getMarcaId());
+ hql.append(" and tb.marca.marcaId = " + marca.getMarcaId());
}
if (claseServicio != null) {
- hql.append(" and t.claseServicio.claseservicioId = " + claseServicio.getClaseservicioId());
+ hql.append(" and tb.claseServicio.claseservicioId = " + claseServicio.getClaseservicioId());
}
if (vigenciaTarifa != null) {
- hql.append(" and t.vigenciaTarifa.vigenciatarifaId = " + vigenciaTarifa.getVigenciatarifaId());
+ hql.append(" and tb.vigenciaTarifa.vigenciatarifaId = " + vigenciaTarifa.getVigenciatarifaId());
}
if (origem != null) {
- hql.append(" and t.origen.paradaId = " + origem.getParadaId());
+ hql.append(" and tb.origen.paradaId = " + origem.getParadaId());
}
if (destino != null) {
- hql.append(" and t.destino.paradaId = " + destino.getParadaId());
+ hql.append(" and tb.destino.paradaId = " + destino.getParadaId());
}
if (ruta != null) {
- hql.append(" and t.ruta.rutaId = " + ruta.getRutaId());
+ hql.append(" and tb.ruta.rutaId = " + ruta.getRutaId());
}
if (via != null) {
- hql.append(" and t.tramo.via.viaId = " + via.getViaId());
+ hql.append(" and tb.tramo.via.viaId = " + via.getViaId());
}
if (vende != null) {
@@ -348,6 +349,14 @@ public class TarifaHibernateDAO extends GenericHibernateDAO imp
Query sq = getSession().createQuery(hql.toString());
sq.executeUpdate();
+ getSession().flush();
+ }catch (Exception e) {
+ String mensagem = "Erro ao excluir Tarifas para origemId:" + ( origem!=null ? origem.getParadaId() : "null") +
+ " destinoId:" + (destino !=null ? destino.getParadaId() : "null") +
+ " marcaId:" + (marca!=null ? marca.getMarcaId() : "null") +
+ " rutaId:" + (ruta !=null ? ruta.getRutaId() : "null");
+ log.error(mensagem, e);
+ }
}