frederico 2017-05-09 18:52:55 +00:00
parent 19c0d546ba
commit 0c7b059f8e
2 changed files with 125 additions and 0 deletions

View File

@ -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;
}
}

View File

@ -212,6 +212,10 @@ public class PuntoVenta implements Serializable {
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
private Date dateAbertura; private Date dateAbertura;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "puntoVenta")
@LazyCollection(LazyCollectionOption.FALSE)
private List<HistoricoPuntoVenta> historicoPuntoVentaList;
public PtovtaEmpresaBloqueada addEmpresaBloqueada(Empresa e) { public PtovtaEmpresaBloqueada addEmpresaBloqueada(Empresa e) {
PtovtaEmpresaBloqueada eb = new PtovtaEmpresaBloqueada(); PtovtaEmpresaBloqueada eb = new PtovtaEmpresaBloqueada();
eb.setEmpresa(e); eb.setEmpresa(e);
@ -286,6 +290,7 @@ public class PuntoVenta implements Serializable {
this.ptovtaSeguroList = new ArrayList<PtoVtaSeguro>(); this.ptovtaSeguroList = new ArrayList<PtoVtaSeguro>();
this.ptovtaCatIndList = new ArrayList<PtovtaCatInd>(); this.ptovtaCatIndList = new ArrayList<PtovtaCatInd>();
this.ptovtaEmpresaBloqueadaList = new ArrayList<PtovtaEmpresaBloqueada>(); this.ptovtaEmpresaBloqueadaList = new ArrayList<PtovtaEmpresaBloqueada>();
this.historicoPuntoVentaList = new ArrayList<HistoricoPuntoVenta>();
} }
public PuntoVenta(Integer puntoventaId) { public PuntoVenta(Integer puntoventaId) {
@ -947,4 +952,14 @@ public class PuntoVenta implements Serializable {
public String getCidade(){ public String getCidade(){
return colonia != null ? colonia.getCidade() : ""; return colonia != null ? colonia.getCidade() : "";
} }
public List<HistoricoPuntoVenta> getHistoricoPuntoVentaList() {
return historicoPuntoVentaList;
}
public void setHistoricoPuntoVentaList(List<HistoricoPuntoVenta> historicoPuntoVentaList) {
this.historicoPuntoVentaList = historicoPuntoVentaList;
}
} }