diff --git a/src/com/rjconsultores/ventaboletos/entidad/HistoricoPuntoVenta.java b/src/com/rjconsultores/ventaboletos/entidad/HistoricoPuntoVenta.java new file mode 100644 index 000000000..be00c9e1a --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/HistoricoPuntoVenta.java @@ -0,0 +1,110 @@ +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.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@SequenceGenerator(name = "HIST_PUNTOVENTA_SEQ", sequenceName = "HIST_PUNTOVENTA_SEQ", allocationSize = 1) +@Table(name = "HIST_PUNTOVENTA") +public class HistoricoPuntoVenta implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "HIST_PUNTOVENTA_SEQ") + @Column(name = "HIST_PUNTOVENTA_ID") + private Integer historicoPuntoVentaId; + + @Column(name = "IND_BLOQUEIO") + private Boolean indBloqueio; + + @Column(name = "FEC_BLOQUEIO") + @Temporal(TemporalType.TIMESTAMP) + private Date fecBloqueio; + + @ManyToOne + @JoinColumn(name = "PUNTOVENTA_ID") + private PuntoVenta puntoVenta; + + @Column(name = "ACTIVO") + private Boolean activo; + + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public Integer getHistoricoPuntoVentaId() { + return historicoPuntoVentaId; + } + + public void setHistoricoPuntoVentaId(Integer historicoPuntoVentaId) { + this.historicoPuntoVentaId = historicoPuntoVentaId; + } + + public Boolean getIndBloqueio() { + return indBloqueio; + } + + public void setIndBloqueio(Boolean indBloqueio) { + this.indBloqueio = indBloqueio; + } + + public Date getFecBloqueio() { + return fecBloqueio; + } + + public void setFecBloqueio(Date fecBloqueio) { + this.fecBloqueio = fecBloqueio; + } + + public PuntoVenta getPuntoVenta() { + return puntoVenta; + } + + public void setPuntoVenta(PuntoVenta puntoVenta) { + this.puntoVenta = puntoVenta; + } + + 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; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + + +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/PuntoVenta.java b/src/com/rjconsultores/ventaboletos/entidad/PuntoVenta.java index 7e2081633..c3fdef90a 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/PuntoVenta.java +++ b/src/com/rjconsultores/ventaboletos/entidad/PuntoVenta.java @@ -212,6 +212,10 @@ public class PuntoVenta implements Serializable { @Temporal(TemporalType.TIMESTAMP) private Date dateAbertura; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "puntoVenta") + @LazyCollection(LazyCollectionOption.FALSE) + private List historicoPuntoVentaList; + public PtovtaEmpresaBloqueada addEmpresaBloqueada(Empresa e) { PtovtaEmpresaBloqueada eb = new PtovtaEmpresaBloqueada(); eb.setEmpresa(e); @@ -286,6 +290,7 @@ public class PuntoVenta implements Serializable { this.ptovtaSeguroList = new ArrayList(); this.ptovtaCatIndList = new ArrayList(); this.ptovtaEmpresaBloqueadaList = new ArrayList(); + this.historicoPuntoVentaList = new ArrayList(); } public PuntoVenta(Integer puntoventaId) { @@ -947,4 +952,14 @@ public class PuntoVenta implements Serializable { public String getCidade(){ return colonia != null ? colonia.getCidade() : ""; } + + public List getHistoricoPuntoVentaList() { + return historicoPuntoVentaList; + } + + public void setHistoricoPuntoVentaList(List historicoPuntoVentaList) { + this.historicoPuntoVentaList = historicoPuntoVentaList; + } + + }