git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@20549 d1611594-4594-4d17-8e1d-87c2c4800839
parent
e2100a92e0
commit
52d8766c68
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||||
|
|
||||||
import org.hibernate.Criteria;
|
import org.hibernate.Criteria;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
|
import org.hibernate.criterion.Order;
|
||||||
import org.hibernate.criterion.Restrictions;
|
import org.hibernate.criterion.Restrictions;
|
||||||
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;
|
||||||
|
@ -26,6 +27,7 @@ public class OrgaoConcedenteHibernateDAO extends GenericHibernateDAO<OrgaoConced
|
||||||
public List<OrgaoConcedente> obtenerTodos() {
|
public List<OrgaoConcedente> obtenerTodos() {
|
||||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
c.addOrder(Order.asc("descOrgao"));
|
||||||
|
|
||||||
return c.list();
|
return c.list();
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,6 +86,11 @@ public class CoeficienteTarifa implements Serializable {
|
||||||
this.usuarioId = usuarioId;
|
this.usuarioId = usuarioId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return descCoeficiente + " - " + coeficiente;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
|
|
|
@ -95,6 +95,11 @@ public class OrgaoConcedente implements Serializable {
|
||||||
this.usuarioId = usuarioId;
|
this.usuarioId = usuarioId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return descOrgao;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
|
|
|
@ -34,237 +34,252 @@ import javax.persistence.SequenceGenerator;
|
||||||
@Table(name = "TRAMO")
|
@Table(name = "TRAMO")
|
||||||
public class Tramo implements Serializable {
|
public class Tramo implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@Id
|
@Id
|
||||||
@Basic(optional = false)
|
@Basic(optional = false)
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "TRAMO_SEQ")
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "TRAMO_SEQ")
|
||||||
@Column(name = "TRAMO_ID")
|
@Column(name = "TRAMO_ID")
|
||||||
private Integer tramoId;
|
private Integer tramoId;
|
||||||
@Column(name = "DESCTRAMO")
|
@Column(name = "DESCTRAMO")
|
||||||
private String desctramo;
|
private String desctramo;
|
||||||
@Column(name = "ACTIVO")
|
@Column(name = "ACTIVO")
|
||||||
private Boolean activo;
|
private Boolean activo;
|
||||||
@Column(name = "FECMODIF")
|
@Column(name = "FECMODIF")
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date fecmodif;
|
private Date fecmodif;
|
||||||
@Column(name = "USUARIO_ID")
|
@Column(name = "USUARIO_ID")
|
||||||
private Integer usuarioId;
|
private Integer usuarioId;
|
||||||
@JoinColumn(name = "VIA_ID", referencedColumnName = "VIA_ID")
|
@JoinColumn(name = "VIA_ID", referencedColumnName = "VIA_ID")
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Via via;
|
private Via via;
|
||||||
@JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID")
|
@JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID")
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Parada origem;
|
private Parada origem;
|
||||||
@JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID")
|
@JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID")
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Parada destino;
|
private Parada destino;
|
||||||
@OneToMany(mappedBy = "tramo")
|
@OneToMany(mappedBy = "tramo")
|
||||||
private List<RutaSecuencia> rutaSecuenciaList;
|
private List<RutaSecuencia> rutaSecuenciaList;
|
||||||
@OneToMany(mappedBy = "tramo")
|
@OneToMany(mappedBy = "tramo")
|
||||||
private List<RutaCombinacion> rutaCombinacionList;
|
private List<RutaCombinacion> rutaCombinacionList;
|
||||||
@OneToMany(cascade = CascadeType.ALL)
|
@OneToMany(cascade = CascadeType.ALL)
|
||||||
@JoinColumn(name = "TRAMO_ID", referencedColumnName = "TRAMO_ID")
|
@JoinColumn(name = "TRAMO_ID", referencedColumnName = "TRAMO_ID")
|
||||||
private List<TramoTiempo> lsTramoTiempo;
|
private List<TramoTiempo> lsTramoTiempo;
|
||||||
@OneToMany(cascade = CascadeType.ALL)
|
@OneToMany(cascade = CascadeType.ALL)
|
||||||
@JoinColumn(name = "TRAMO_ID", referencedColumnName = "TRAMO_ID")
|
@JoinColumn(name = "TRAMO_ID", referencedColumnName = "TRAMO_ID")
|
||||||
private List<TramoServicio> tramoServicioList;
|
private List<TramoServicio> tramoServicioList;
|
||||||
@Column(name = "CANTKMPAGOCONDUCTOR")
|
@Column(name = "CANTKMPAGOCONDUCTOR")
|
||||||
private BigDecimal kmPagoConductor;
|
private BigDecimal kmPagoConductor;
|
||||||
@Column(name = "CANTKMREAL")
|
@Column(name = "CANTKMREAL")
|
||||||
private BigDecimal kmReal;
|
private BigDecimal kmReal;
|
||||||
@OneToMany(cascade = CascadeType.ALL)
|
@OneToMany(cascade = CascadeType.ALL)
|
||||||
@JoinColumn(name = "TRAMO_ID", referencedColumnName = "TRAMO_ID")
|
@JoinColumn(name = "TRAMO_ID", referencedColumnName = "TRAMO_ID")
|
||||||
private List<TramoKm> tramoKms;
|
private List<TramoKm> tramoKms;
|
||||||
|
@OneToMany(cascade = CascadeType.ALL)
|
||||||
|
@JoinColumn(name = "TRAMO_ID", referencedColumnName = "TRAMO_ID")
|
||||||
|
private List<OrgaoTramo> lsOrgaoTramo;
|
||||||
|
|
||||||
public Tramo() {
|
public Tramo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Tramo(Integer tramoId) {
|
public Tramo(Integer tramoId) {
|
||||||
this.tramoId = tramoId;
|
this.tramoId = tramoId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getTramoId() {
|
public Integer getTramoId() {
|
||||||
return tramoId;
|
return tramoId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTramoId(Integer tramoId) {
|
public void setTramoId(Integer tramoId) {
|
||||||
this.tramoId = tramoId;
|
this.tramoId = tramoId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDesctramo() {
|
public String getDesctramo() {
|
||||||
return desctramo;
|
return desctramo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDesctramo(String desctramo) {
|
public void setDesctramo(String desctramo) {
|
||||||
this.desctramo = desctramo;
|
this.desctramo = desctramo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean getActivo() {
|
public Boolean getActivo() {
|
||||||
return activo;
|
return activo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setActivo(Boolean activo) {
|
public void setActivo(Boolean activo) {
|
||||||
this.activo = activo;
|
this.activo = activo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getFecmodif() {
|
public Date getFecmodif() {
|
||||||
return fecmodif;
|
return fecmodif;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFecmodif(Date fecmodif) {
|
public void setFecmodif(Date fecmodif) {
|
||||||
this.fecmodif = fecmodif;
|
this.fecmodif = fecmodif;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getUsuarioId() {
|
public Integer getUsuarioId() {
|
||||||
return usuarioId;
|
return usuarioId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUsuarioId(Integer usuarioId) {
|
public void setUsuarioId(Integer usuarioId) {
|
||||||
this.usuarioId = usuarioId;
|
this.usuarioId = usuarioId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Via getVia() {
|
public Via getVia() {
|
||||||
return via;
|
return via;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVia(Via via) {
|
public void setVia(Via via) {
|
||||||
this.via = via;
|
this.via = via;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Parada getDestino() {
|
public Parada getDestino() {
|
||||||
return destino;
|
return destino;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDestino(Parada destino) {
|
public void setDestino(Parada destino) {
|
||||||
this.destino = destino;
|
this.destino = destino;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Parada getOrigem() {
|
public Parada getOrigem() {
|
||||||
return origem;
|
return origem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOrigem(Parada origem) {
|
public void setOrigem(Parada origem) {
|
||||||
this.origem = origem;
|
this.origem = origem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<RutaSecuencia> getRutaSecuenciaList() {
|
public List<RutaSecuencia> getRutaSecuenciaList() {
|
||||||
List<RutaSecuencia> lsRutaSecuencia = new ArrayList<RutaSecuencia>();
|
List<RutaSecuencia> lsRutaSecuencia = new ArrayList<RutaSecuencia>();
|
||||||
for (RutaSecuencia rSecuencia : this.rutaSecuenciaList) {
|
for (RutaSecuencia rSecuencia : this.rutaSecuenciaList) {
|
||||||
if (rSecuencia.getActivo()) {
|
if (rSecuencia.getActivo()) {
|
||||||
lsRutaSecuencia.add(rSecuencia);
|
lsRutaSecuencia.add(rSecuencia);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.rutaSecuenciaList = lsRutaSecuencia;
|
this.rutaSecuenciaList = lsRutaSecuencia;
|
||||||
|
|
||||||
return lsRutaSecuencia;
|
return lsRutaSecuencia;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRutaSecuenciaList(List<RutaSecuencia> rutaSecuenciaList) {
|
public void setRutaSecuenciaList(List<RutaSecuencia> rutaSecuenciaList) {
|
||||||
this.rutaSecuenciaList = rutaSecuenciaList;
|
this.rutaSecuenciaList = rutaSecuenciaList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<RutaCombinacion> getRutaCombinacionList() {
|
public List<RutaCombinacion> getRutaCombinacionList() {
|
||||||
List<RutaCombinacion> lsRutaCombinacion = new ArrayList<RutaCombinacion>();
|
List<RutaCombinacion> lsRutaCombinacion = new ArrayList<RutaCombinacion>();
|
||||||
for (RutaCombinacion rCombinacion : this.rutaCombinacionList) {
|
for (RutaCombinacion rCombinacion : this.rutaCombinacionList) {
|
||||||
if (rCombinacion.getActivo()) {
|
if (rCombinacion.getActivo()) {
|
||||||
lsRutaCombinacion.add(rCombinacion);
|
lsRutaCombinacion.add(rCombinacion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.rutaCombinacionList = lsRutaCombinacion;
|
this.rutaCombinacionList = lsRutaCombinacion;
|
||||||
|
|
||||||
return lsRutaCombinacion;
|
return lsRutaCombinacion;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRutaCombinacionList(List<RutaCombinacion> rutaCombinacionList) {
|
public void setRutaCombinacionList(List<RutaCombinacion> rutaCombinacionList) {
|
||||||
this.rutaCombinacionList = rutaCombinacionList;
|
this.rutaCombinacionList = rutaCombinacionList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TramoServicio> getTramoServicioList() {
|
public List<TramoServicio> getTramoServicioList() {
|
||||||
List<TramoServicio> lsTramoServicio = new ArrayList<TramoServicio>();
|
List<TramoServicio> lsTramoServicio = new ArrayList<TramoServicio>();
|
||||||
for (TramoServicio tramoServicio : this.tramoServicioList) {
|
for (TramoServicio tramoServicio : this.tramoServicioList) {
|
||||||
if (tramoServicio.getActivo()) {
|
if (tramoServicio.getActivo()) {
|
||||||
lsTramoServicio.add(tramoServicio);
|
lsTramoServicio.add(tramoServicio);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.tramoServicioList = lsTramoServicio;
|
this.tramoServicioList = lsTramoServicio;
|
||||||
|
|
||||||
return lsTramoServicio;
|
return lsTramoServicio;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTramoServicioList(List<TramoServicio> tramoServicioList) {
|
public void setTramoServicioList(List<TramoServicio> tramoServicioList) {
|
||||||
this.tramoServicioList = tramoServicioList;
|
this.tramoServicioList = tramoServicioList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TramoTiempo> getLsTramoTiempo() {
|
public List<TramoTiempo> getLsTramoTiempo() {
|
||||||
List<TramoTiempo> lsTmp = new ArrayList<TramoTiempo>();
|
List<TramoTiempo> lsTmp = new ArrayList<TramoTiempo>();
|
||||||
for (TramoTiempo tramoAtributo : this.lsTramoTiempo) {
|
for (TramoTiempo tramoAtributo : this.lsTramoTiempo) {
|
||||||
if (tramoAtributo.getActivo()) {
|
if (tramoAtributo.getActivo()) {
|
||||||
lsTmp.add(tramoAtributo);
|
lsTmp.add(tramoAtributo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.lsTramoTiempo = lsTmp;
|
this.lsTramoTiempo = lsTmp;
|
||||||
|
|
||||||
return lsTmp;
|
return lsTmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLsTramoTiempo(List<TramoTiempo> lsTramoTiempo) {
|
public void setLsTramoTiempo(List<TramoTiempo> lsTramoTiempo) {
|
||||||
this.lsTramoTiempo = lsTramoTiempo;
|
this.lsTramoTiempo = lsTramoTiempo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = 0;
|
int hash = 0;
|
||||||
hash += (tramoId != null ? tramoId.hashCode() : 0);
|
hash += (tramoId != null ? tramoId.hashCode() : 0);
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getKmPagoConductor() {
|
public BigDecimal getKmPagoConductor() {
|
||||||
return kmPagoConductor;
|
return kmPagoConductor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setKmPagoConductor(BigDecimal kmPagoConductor) {
|
public void setKmPagoConductor(BigDecimal kmPagoConductor) {
|
||||||
this.kmPagoConductor = kmPagoConductor;
|
this.kmPagoConductor = kmPagoConductor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getKmReal() {
|
public BigDecimal getKmReal() {
|
||||||
return kmReal;
|
return kmReal;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setKmReal(BigDecimal kmReal) {
|
public void setKmReal(BigDecimal kmReal) {
|
||||||
this.kmReal = kmReal;
|
this.kmReal = kmReal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public List<OrgaoTramo> getLsOrgaoTramo() {
|
||||||
public boolean equals(Object object) {
|
List<OrgaoTramo> tmp = new ArrayList<OrgaoTramo>();
|
||||||
// TODO: Warning - this method won't work in the case the id fields are not set
|
for (OrgaoTramo orgaoTramo : this.lsOrgaoTramo) {
|
||||||
if (!(object instanceof Tramo)) {
|
if (orgaoTramo.getActivo()) {
|
||||||
return false;
|
tmp.add(orgaoTramo);
|
||||||
}
|
}
|
||||||
Tramo other = (Tramo) object;
|
}
|
||||||
if ((this.tramoId == null && other.tramoId != null) || (this.tramoId != null && !this.tramoId.equals(other.tramoId))) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<TramoKm> getTramoKms() {
|
this.lsOrgaoTramo = tmp;
|
||||||
return tramoKms;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTramoKms(List<TramoKm> tramoKms) {
|
return tmp;
|
||||||
this.tramoKms = tramoKms;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// @Override
|
public void setLsOrgaoTramo(List<OrgaoTramo> lsOrgaoTramo) {
|
||||||
// public String toString() {
|
this.lsOrgaoTramo = lsOrgaoTramo;
|
||||||
// return getDesctramo();
|
}
|
||||||
// }
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public boolean equals(Object object) {
|
||||||
return getDesctramo().concat(" - ").concat(this.getVia().getNombvia());
|
if (!(object instanceof Tramo)) {
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
|
Tramo other = (Tramo) object;
|
||||||
|
if ((this.tramoId == null && other.tramoId != null) || (this.tramoId != null && !this.tramoId.equals(other.tramoId))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TramoKm> getTramoKms() {
|
||||||
|
return tramoKms;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTramoKms(List<TramoKm> tramoKms) {
|
||||||
|
this.tramoKms = tramoKms;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return getDesctramo().concat(" - ").concat(this.getVia().getNombvia());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue