fixes bug #7588
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@58712 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
c36814600f
commit
09aa056bc7
|
@ -146,6 +146,9 @@ public class CalcularPeajeHibernateDAO extends GenericHibernateDAO<String, Strin
|
||||||
"where ruta_id = " + pvo.rutaId +
|
"where ruta_id = " + pvo.rutaId +
|
||||||
" and origen_id = " + pvo.origenId + " and " +
|
" and origen_id = " + pvo.origenId + " and " +
|
||||||
"destino_id = " + pvo.destinoId + ")");
|
"destino_id = " + pvo.destinoId + ")");
|
||||||
|
batchExcepcionPeajeVigenciaSql.add("update EXCEPCION_PEAJE set activo = 0 where ruta_id = " + pvo.rutaId +
|
||||||
|
" and origen_id = " + pvo.origenId + " and " +
|
||||||
|
"destino_id = " + pvo.destinoId + "");
|
||||||
peajes.add(pvo);
|
peajes.add(pvo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -196,7 +199,7 @@ public class CalcularPeajeHibernateDAO extends GenericHibernateDAO<String, Strin
|
||||||
|
|
||||||
private ExcepcionPeaje getExcepcion(Integer rutaId, Integer origenId, Integer destinoId){
|
private ExcepcionPeaje getExcepcion(Integer rutaId, Integer origenId, Integer destinoId){
|
||||||
Query query = getSession().createQuery("select e from ExcepcionPeaje e where e.ruta.rutaId = :rutaId "+
|
Query query = getSession().createQuery("select e from ExcepcionPeaje e where e.ruta.rutaId = :rutaId "+
|
||||||
"and e.origem.paradaId = :origenId and e.destino.paradaId = :destinoId ");
|
"and e.origem.paradaId = :origenId and e.destino.paradaId = :destinoId and e.activo = 1 ");
|
||||||
|
|
||||||
query.setInteger("rutaId", rutaId);
|
query.setInteger("rutaId", rutaId);
|
||||||
query.setInteger("origenId", origenId);
|
query.setInteger("origenId", origenId);
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class CasetaPeajeExcepcionHibernateDAO extends GenericHibernateDAO<Caseta
|
||||||
public List<CasetaPeajeExcepcion> obtenerPorCasetaPeaje(CasetaPeaje caseta) {
|
public List<CasetaPeajeExcepcion> obtenerPorCasetaPeaje(CasetaPeaje caseta) {
|
||||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
c.add(Restrictions.eq("casetaPeaje", caseta));
|
c.add(Restrictions.eq("casetaPeaje", caseta));
|
||||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
c.add(Restrictions.eq("activo", true)).setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
|
||||||
|
|
||||||
return c.list();
|
return c.list();
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,8 +51,8 @@ public class CasetaPeaje implements Serializable, Comparable<CasetaPeaje>, Clone
|
||||||
private Date fecmodif;
|
private Date fecmodif;
|
||||||
@Column(name = "USUARIO_ID")
|
@Column(name = "USUARIO_ID")
|
||||||
private Integer usuarioId;
|
private Integer usuarioId;
|
||||||
@OneToMany(mappedBy = "casetaPeaje", fetch=FetchType.LAZY, cascade = CascadeType.ALL)
|
@OneToMany(mappedBy = "casetaPeaje")
|
||||||
//@Fetch(FetchMode.SELECT)
|
@Where(clause="ACTIVO=1")
|
||||||
private List<CasetaPeajeExcepcion> lsCasetaPeajeExcepcion = new ArrayList<CasetaPeajeExcepcion>();
|
private List<CasetaPeajeExcepcion> lsCasetaPeajeExcepcion = new ArrayList<CasetaPeajeExcepcion>();
|
||||||
@ManyToMany(fetch=FetchType.EAGER)
|
@ManyToMany(fetch=FetchType.EAGER)
|
||||||
@JoinTable(name = "RUTA_CASETA", joinColumns = { @JoinColumn(name = "CASETAPEAJE_ID") },
|
@JoinTable(name = "RUTA_CASETA", joinColumns = { @JoinColumn(name = "CASETAPEAJE_ID") },
|
||||||
|
|
|
@ -180,4 +180,24 @@ private static final long serialVersionUID = 1L;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 0;
|
||||||
|
hash += casetaPeajeExcepcionId != null ? casetaPeajeExcepcionId.hashCode() : 0;
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object object) {
|
||||||
|
if (!(object instanceof CasetaPeajeExcepcion)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
CasetaPeajeExcepcion other = (CasetaPeajeExcepcion) object;
|
||||||
|
if ((this.casetaPeajeExcepcionId == null && other.casetaPeajeExcepcionId != null) || (this.casetaPeajeExcepcionId != null && !this.casetaPeajeExcepcionId.equals(other.casetaPeajeExcepcionId))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue