diff --git a/src/com/rjconsultores/ventaboletos/entidad/Estacion.java b/src/com/rjconsultores/ventaboletos/entidad/Estacion.java index 6fe220583..ef875d073 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/Estacion.java +++ b/src/com/rjconsultores/ventaboletos/entidad/Estacion.java @@ -81,6 +81,8 @@ public class Estacion implements Serializable { @OneToMany(mappedBy = "estacion", cascade = CascadeType.ALL, fetch = FetchType.EAGER) private List estacionSitefList; @OneToMany(mappedBy = "estacion", cascade = CascadeType.ALL) + private List estacionRioCardList; + @OneToMany(mappedBy = "estacion", cascade = CascadeType.ALL) private List lsEstacionImpresora; @OneToMany(mappedBy = "estacion", cascade = CascadeType.ALL) private List abastoBoletoList; @@ -234,6 +236,24 @@ public class Estacion implements Serializable { public void setEstacionSitefList(List estacionSitefList) { this.estacionSitefList = estacionSitefList; } + + public List getEstacionRioCardList() { + List tmp = new ArrayList(); + + if (estacionRioCardList != null) { + for (EstacionRioCard es : estacionRioCardList) { + if (es.getActivo()) { + tmp.add(es); + } + } + } + + return tmp; + } + + public void setEstacionRioCardList(List estacionRioCardList) { + this.estacionRioCardList = estacionRioCardList; + } public List getLsEstacionImpresora() { List tmp = new ArrayList(); diff --git a/src/com/rjconsultores/ventaboletos/entidad/EstacionRioCard.java b/src/com/rjconsultores/ventaboletos/entidad/EstacionRioCard.java new file mode 100644 index 000000000..b03fd2d6c --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/EstacionRioCard.java @@ -0,0 +1,143 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +/** + * + * @author RJ + */ +@Entity +@Table(name = "ESTACION_RIOCARD") +@SequenceGenerator(name = "ESTACION_RIOCARD_SEQ", sequenceName = "ESTACION_RIOCARD_SEQ", allocationSize = 1) +public class EstacionRioCard implements Serializable { + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "ESTACION_RIOCARD_SEQ") + @Column(name = "ESTACIONRIOCARD_ID") + private Integer estacionRioCardId; + @Column(name = "OPERADORA") + private String operadora; + @OneToOne + @JoinColumn(name = "EMPRESA_ID") + private Empresa empresa; + @ManyToOne + @JoinColumn(name = "ESTACION_ID", referencedColumnName = "ESTACION_ID") + private Estacion estacion; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + public EstacionRioCard() { + } + + public EstacionRioCard(Integer estacionRioCardId) { + this.estacionRioCardId = estacionRioCardId; + } + + @Override + public int hashCode() { + int hash = 0; + hash += (estacionRioCardId != null ? estacionRioCardId.hashCode() : 0); + return hash; + } + + public Integer getEstacionRioCardId() { + return estacionRioCardId; + } + + public void setEstacionRioCardId(Integer estacionRioCardId) { + this.estacionRioCardId = estacionRioCardId; + } + + public String getOperadora() { + return operadora; + } + + public void setOperadora(String operadora) { + this.operadora = operadora; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public Estacion getEstacion() { + return estacion; + } + + public void setEstacion(Estacion estacion) { + this.estacion = estacion; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + @Override + public boolean equals(Object object) { + // TODO: Warning - this method won't work in the case the id fields are + // not set + if (!(object instanceof EstacionRioCard)) { + return false; + } + EstacionRioCard other = (EstacionRioCard) object; + if ((this.estacionRioCardId == null && other.estacionRioCardId != null) || (this.estacionRioCardId != null && !this.estacionRioCardId.equals(other.estacionRioCardId))) { + return false; + } + return true; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.EstacionRiocard[ estacionRioCardId=" + estacionRioCardId + " ]"; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/utilerias/ApplicationProperties.java b/src/com/rjconsultores/ventaboletos/utilerias/ApplicationProperties.java index 1c238d7e8..e336399a3 100644 --- a/src/com/rjconsultores/ventaboletos/utilerias/ApplicationProperties.java +++ b/src/com/rjconsultores/ventaboletos/utilerias/ApplicationProperties.java @@ -144,5 +144,10 @@ public class ApplicationProperties { String property = p.getProperty("integracion.totvs", "0"); return property.equals("1"); } + + public boolean integracionRioCard() { + String property = p.getProperty("integracion.riocard", "0"); + return property.equals("1"); + } }