506 lines
14 KiB
Java
506 lines
14 KiB
Java
/*
|
||
* 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.math.BigDecimal;
|
||
import java.util.ArrayList;
|
||
import java.util.Date;
|
||
import java.util.List;
|
||
import javax.persistence.Basic;
|
||
import javax.persistence.CascadeType;
|
||
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.OneToMany;
|
||
import javax.persistence.SequenceGenerator;
|
||
import javax.persistence.Table;
|
||
import javax.persistence.Temporal;
|
||
import javax.persistence.TemporalType;
|
||
|
||
/**
|
||
*
|
||
* @author Rafius
|
||
*/
|
||
@Entity
|
||
@SequenceGenerator(name = "PRICING_SEQ", sequenceName = "PRICING_SEQ", allocationSize = 1)
|
||
@Table(name = "PRICING")
|
||
public class Pricing implements Serializable {
|
||
|
||
private static final long serialVersionUID = 1L;
|
||
@Id
|
||
@Basic(optional = false)
|
||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "PRICING_SEQ")
|
||
@Column(name = "PRICING_ID")
|
||
private Integer pricingId;
|
||
@Column(name = "NOMBPRICING")
|
||
private String nombPricing;
|
||
@Column(name = "CANTBOLETO")
|
||
private Short cantboleto;
|
||
// Rafael - Campo retirado pela Leticia no dia 15/02/2011.
|
||
// @Column(name = "DESCUENTOIMPORTE")
|
||
// private BigDecimal descuentoimporte;
|
||
@Column(name = "DESCUENTOPORCENTAJE")
|
||
private BigDecimal descuentoporcentaje;
|
||
@Column(name = "DESCUENTOPORCREDONDO")
|
||
private BigDecimal descuentoporcredondo;
|
||
@Column(name = "INDTRANSFERIBLE")
|
||
private Boolean indtransferible;
|
||
@Column(name = "INDRESERVABLE")
|
||
private Boolean indreservable;
|
||
@Column(name = "INDCANCELABLE")
|
||
private Boolean indcancelable;
|
||
@Column(name = "ACTIVO")
|
||
private Boolean activo;
|
||
@Column(name = "FECMODIF")
|
||
@Temporal(TemporalType.TIMESTAMP)
|
||
private Date fecmodif;
|
||
@Column(name = "USUARIO_ID")
|
||
private Integer usuarioId;
|
||
@Column(name = "CANTDIASANTICIPACION")
|
||
private Integer cantdiasanticipacion;
|
||
@OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL)
|
||
private List<PricingOcupacion> pricingOcupacionList;
|
||
@OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL)
|
||
private List<PricingAsiento> pricingAsientoList;
|
||
@OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL)
|
||
private List<PricingMercado> pricingMercadoList;
|
||
@OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL)
|
||
private List<PricingMarca> pricingMarcaList;
|
||
@JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID")
|
||
@ManyToOne
|
||
private Empresa empresa;
|
||
@OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL)
|
||
private List<PricingRuta> pricingRutaList;
|
||
@OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL)
|
||
private List<PricingDia> pricingDiaList;
|
||
@OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL)
|
||
private List<PricingImporte> pricingImporteList;
|
||
@OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL)
|
||
private List<PricingTipoPtoVta> pricingTipoptovtaList;
|
||
@OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL)
|
||
private List<PricingCategoria> pricingCategoriaList;
|
||
@OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL)
|
||
private List<PricingVigencia> pricingVigenciaList;
|
||
@OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL)
|
||
private List<PricingClase> pricingClaseList;
|
||
@OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL)
|
||
private List<PricingCorrida> pricingCorridaList;
|
||
@OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL)
|
||
private List<PricingPuntoVenta> pricingPuntoventaList;
|
||
@OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL)
|
||
private List<PricingAnticipacion> pricingAnticipacionList;
|
||
@OneToMany(mappedBy = "pricing", cascade = CascadeType.ALL)
|
||
private List<PricingTipoServicio> pricingTipoServicioList;
|
||
@Column(name = "INDGENERAFERIADOVIAJE")
|
||
private String indGeneraFeriadoViaje;
|
||
@Column(name = "INDGENERAFERIADOVENTA")
|
||
private String indGeneraFeriadoVenta;
|
||
|
||
public enum GerarFeriado {
|
||
// Declara<72><61>o dos enum
|
||
GERARSEMPRE("GERAR SEMPRE", "S"),
|
||
|
||
GERARQUANDOFERIADO("GERAR S<> QUANDO FOR FERIADO", "F"),
|
||
|
||
GERARQUANDONAOFERIADO("GERAR QUANDO N<>O FOR FERIADO", "N");
|
||
|
||
// Defini<6E><69>o das constantes
|
||
public final String valor;
|
||
public final String descricao;
|
||
|
||
public String valor() {
|
||
return this.valor;
|
||
}
|
||
|
||
public String descricao() {
|
||
return this.descricao;
|
||
}
|
||
|
||
private GerarFeriado(String descricao, String valor) {
|
||
this.descricao = descricao;
|
||
this.valor = valor;
|
||
}
|
||
}
|
||
|
||
public Pricing() {
|
||
}
|
||
|
||
public Pricing(Integer pricingId) {
|
||
this.pricingId = pricingId;
|
||
}
|
||
|
||
public Integer getPricingId() {
|
||
return pricingId;
|
||
}
|
||
|
||
public void setPricingId(Integer pricingId) {
|
||
this.pricingId = pricingId;
|
||
}
|
||
|
||
public Short getCantboleto() {
|
||
return cantboleto;
|
||
}
|
||
|
||
public Integer getCantdiasanticipacion() {
|
||
return cantdiasanticipacion;
|
||
}
|
||
|
||
public void setCantdiasanticipacion(Integer cantdiasanticipacion) {
|
||
this.cantdiasanticipacion = cantdiasanticipacion;
|
||
}
|
||
|
||
public void setCantboleto(Short cantboleto) {
|
||
this.cantboleto = cantboleto;
|
||
}
|
||
|
||
public BigDecimal getDescuentoporcentaje() {
|
||
return descuentoporcentaje;
|
||
}
|
||
|
||
public void setDescuentoporcentaje(BigDecimal descuentoporcentaje) {
|
||
this.descuentoporcentaje = descuentoporcentaje;
|
||
}
|
||
|
||
public BigDecimal getDescuentoporcredondo() {
|
||
return descuentoporcredondo;
|
||
}
|
||
|
||
public void setDescuentoporcredondo(BigDecimal descuentoporcredondo) {
|
||
this.descuentoporcredondo = descuentoporcredondo;
|
||
}
|
||
|
||
public Boolean getIndtransferible() {
|
||
return indtransferible;
|
||
}
|
||
|
||
public void setIndtransferible(Boolean indtransferible) {
|
||
this.indtransferible = indtransferible;
|
||
}
|
||
|
||
public Boolean getIndreservable() {
|
||
return indreservable;
|
||
}
|
||
|
||
public void setIndreservable(Boolean indreservable) {
|
||
this.indreservable = indreservable;
|
||
}
|
||
|
||
public Boolean getIndcancelable() {
|
||
return indcancelable;
|
||
}
|
||
|
||
public void setIndcancelable(Boolean indcancelable) {
|
||
this.indcancelable = indcancelable;
|
||
}
|
||
|
||
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;
|
||
}
|
||
|
||
public List<PricingOcupacion> getPricingOcupacionList() {
|
||
List<PricingOcupacion> poList = new ArrayList<PricingOcupacion>();
|
||
for (PricingOcupacion po : this.pricingOcupacionList) {
|
||
if (po.getActivo() == Boolean.TRUE) {
|
||
poList.add(po);
|
||
}
|
||
}
|
||
return poList;
|
||
}
|
||
|
||
public void setPricingOcupacionList(List<PricingOcupacion> pricingOcupacionList) {
|
||
this.pricingOcupacionList = pricingOcupacionList;
|
||
}
|
||
|
||
public List<PricingAsiento> getPricingAsientoList() {
|
||
List<PricingAsiento> paList = new ArrayList<PricingAsiento>();
|
||
for (PricingAsiento pa : this.pricingAsientoList) {
|
||
if (pa.getActivo() == Boolean.TRUE) {
|
||
paList.add(pa);
|
||
}
|
||
}
|
||
return paList;
|
||
}
|
||
|
||
public void setPricingAsientoList(List<PricingAsiento> pricingAsientoList) {
|
||
this.pricingAsientoList = pricingAsientoList;
|
||
}
|
||
|
||
public List<PricingMercado> getPricingMercadoList() {
|
||
List<PricingMercado> pmList = new ArrayList<PricingMercado>();
|
||
for (PricingMercado pm : this.pricingMercadoList) {
|
||
if (pm.getActivo() == Boolean.TRUE) {
|
||
pmList.add(pm);
|
||
}
|
||
}
|
||
return pmList;
|
||
}
|
||
|
||
public void setPricingMercadoList(List<PricingMercado> pricingMercadoList) {
|
||
this.pricingMercadoList = pricingMercadoList;
|
||
}
|
||
|
||
public List<PricingMarca> getPricingMarcaList() {
|
||
List<PricingMarca> pmList = new ArrayList<PricingMarca>();
|
||
for (PricingMarca pm : this.pricingMarcaList) {
|
||
if (pm.getActivo() == Boolean.TRUE) {
|
||
pmList.add(pm);
|
||
}
|
||
}
|
||
return pmList;
|
||
}
|
||
|
||
public void setPricingMarcaList(List<PricingMarca> pricingMarcaList) {
|
||
this.pricingMarcaList = pricingMarcaList;
|
||
}
|
||
|
||
public Empresa getEmpresa() {
|
||
return empresa;
|
||
}
|
||
|
||
public void setEmpresa(Empresa empresa) {
|
||
this.empresa = empresa;
|
||
}
|
||
|
||
public List<PricingRuta> getPricingRutaList() {
|
||
List<PricingRuta> prList = new ArrayList<PricingRuta>();
|
||
for (PricingRuta pr : this.pricingRutaList) {
|
||
if (pr.getActivo() == Boolean.TRUE) {
|
||
prList.add(pr);
|
||
}
|
||
}
|
||
return prList;
|
||
}
|
||
|
||
public void setPricingRutaList(List<PricingRuta> pricingRutaList) {
|
||
this.pricingRutaList = pricingRutaList;
|
||
}
|
||
|
||
public List<PricingDia> getPricingDiaList() {
|
||
List<PricingDia> pdList = new ArrayList<PricingDia>();
|
||
for (PricingDia pd : this.pricingDiaList) {
|
||
if (pd.getActivo() == Boolean.TRUE) {
|
||
pdList.add(pd);
|
||
}
|
||
}
|
||
return pdList;
|
||
}
|
||
|
||
public void setPricingDiaList(List<PricingDia> pricingDiaList) {
|
||
this.pricingDiaList = pricingDiaList;
|
||
}
|
||
|
||
public List<PricingImporte> getPricingImporteList() {
|
||
List<PricingImporte> piList = new ArrayList<PricingImporte>();
|
||
for (PricingImporte pi : this.pricingImporteList) {
|
||
if (pi.getActivo() == Boolean.TRUE) {
|
||
piList.add(pi);
|
||
}
|
||
}
|
||
return piList;
|
||
}
|
||
|
||
public void setPricingImporteList(List<PricingImporte> pricingImporteList) {
|
||
this.pricingImporteList = pricingImporteList;
|
||
}
|
||
|
||
public List<PricingTipoPtoVta> getPricingTipoptovtaList() {
|
||
List<PricingTipoPtoVta> ptList = new ArrayList<PricingTipoPtoVta>();
|
||
for (PricingTipoPtoVta pt : this.pricingTipoptovtaList) {
|
||
if (pt.getActivo() == Boolean.TRUE) {
|
||
ptList.add(pt);
|
||
}
|
||
}
|
||
return ptList;
|
||
}
|
||
|
||
public void setPricingTipoptovtaList(List<PricingTipoPtoVta> pricingTipoptovtaList) {
|
||
this.pricingTipoptovtaList = pricingTipoptovtaList;
|
||
}
|
||
|
||
public List<PricingCategoria> getPricingCategoriaList() {
|
||
List<PricingCategoria> pcList = new ArrayList<PricingCategoria>();
|
||
for (PricingCategoria pc : this.pricingCategoriaList) {
|
||
if (pc.getActivo() == Boolean.TRUE) {
|
||
pcList.add(pc);
|
||
}
|
||
}
|
||
return pcList;
|
||
}
|
||
|
||
public void setPricingCategoriaList(List<PricingCategoria> pricingCategoriaList) {
|
||
this.pricingCategoriaList = pricingCategoriaList;
|
||
}
|
||
|
||
public List<PricingVigencia> getPricingVigenciaList() {
|
||
List<PricingVigencia> pvList = new ArrayList<PricingVigencia>();
|
||
if (this.pricingVigenciaList != null){
|
||
for (PricingVigencia pv : this.pricingVigenciaList) {
|
||
if (pv.getActivo() == Boolean.TRUE) {
|
||
pvList.add(pv);
|
||
}
|
||
}
|
||
}
|
||
return pvList;
|
||
}
|
||
|
||
public void setPricingVigenciaList(List<PricingVigencia> pricingVigenciaList) {
|
||
this.pricingVigenciaList = pricingVigenciaList;
|
||
}
|
||
|
||
public List<PricingClase> getPricingClaseList() {
|
||
List<PricingClase> pcList = new ArrayList<PricingClase>();
|
||
for (PricingClase pc : this.pricingClaseList) {
|
||
if (pc.getActivo() == Boolean.TRUE) {
|
||
pcList.add(pc);
|
||
}
|
||
}
|
||
return pcList;
|
||
}
|
||
|
||
public void setPricingClaseList(List<PricingClase> pricingClaseList) {
|
||
this.pricingClaseList = pricingClaseList;
|
||
}
|
||
|
||
public List<PricingCorrida> getPricingCorridaList() {
|
||
|
||
List<PricingCorrida> pcList = new ArrayList<PricingCorrida>();
|
||
if (pricingCorridaList == null) {
|
||
return null;
|
||
}
|
||
for (PricingCorrida pc : this.pricingCorridaList) {
|
||
if (pc.getActivo() == Boolean.TRUE) {
|
||
pcList.add(pc);
|
||
}
|
||
}
|
||
return pcList;
|
||
}
|
||
|
||
public void setPricingCorridaList(List<PricingCorrida> pricingCorridaList) {
|
||
this.pricingCorridaList = pricingCorridaList;
|
||
}
|
||
|
||
public List<PricingPuntoVenta> getPricingPuntoventaList() {
|
||
List<PricingPuntoVenta> ppList = new ArrayList<PricingPuntoVenta>();
|
||
for (PricingPuntoVenta pp : this.pricingPuntoventaList) {
|
||
if (pp.getActivo() == Boolean.TRUE) {
|
||
ppList.add(pp);
|
||
}
|
||
}
|
||
return ppList;
|
||
}
|
||
|
||
public void setPricingPuntoventaList(List<PricingPuntoVenta> pricingPuntoventaList) {
|
||
this.pricingPuntoventaList = pricingPuntoventaList;
|
||
}
|
||
|
||
public List<PricingAnticipacion> getPricingAnticipacionList() {
|
||
List<PricingAnticipacion> ppList = new ArrayList<PricingAnticipacion>();
|
||
for (PricingAnticipacion pp : this.pricingAnticipacionList) {
|
||
if (pp.getActivo() == Boolean.TRUE) {
|
||
ppList.add(pp);
|
||
}
|
||
}
|
||
return ppList;
|
||
}
|
||
|
||
public void setPricingAnticipacionList(List<PricingAnticipacion> pricingAnticipacionList) {
|
||
this.pricingAnticipacionList = pricingAnticipacionList;
|
||
}
|
||
|
||
public List<PricingTipoServicio> getPricingTipoServicioList() {
|
||
List<PricingTipoServicio> ppList = new ArrayList<PricingTipoServicio>();
|
||
for (PricingTipoServicio pp : this.pricingTipoServicioList) {
|
||
if (pp.getActivo() == Boolean.TRUE) {
|
||
ppList.add(pp);
|
||
}
|
||
}
|
||
return ppList;
|
||
}
|
||
|
||
public void setPricingTipoServicioList(List<PricingTipoServicio> pricingTipoServicioList) {
|
||
this.pricingTipoServicioList = pricingTipoServicioList;
|
||
}
|
||
|
||
public String getIndGeneraFeriadoViaje() {
|
||
return indGeneraFeriadoViaje;
|
||
}
|
||
|
||
public void setIndGeneraFeriadoViaje(String indGeneraFeriadoViaje) {
|
||
this.indGeneraFeriadoViaje = indGeneraFeriadoViaje;
|
||
}
|
||
|
||
public String getIndGeneraFeriadoVenta() {
|
||
return indGeneraFeriadoVenta;
|
||
}
|
||
|
||
public void setIndGeneraFeriadoVenta(String indGeneraFeriadoVenta) {
|
||
this.indGeneraFeriadoVenta = indGeneraFeriadoVenta;
|
||
}
|
||
|
||
@Override
|
||
public int hashCode() {
|
||
int hash = 0;
|
||
hash += (pricingId != null ? pricingId.hashCode() : 0);
|
||
return hash;
|
||
}
|
||
|
||
@Override
|
||
public boolean equals(Object object) {
|
||
if (!(object instanceof Pricing)) {
|
||
return false;
|
||
}
|
||
Pricing other = (Pricing) object;
|
||
if ((this.pricingId == null && other.pricingId != null) || (this.pricingId != null && !this.pricingId.equals(other.pricingId))) {
|
||
return false;
|
||
}
|
||
return true;
|
||
}
|
||
|
||
@Override
|
||
public String toString() {
|
||
return "entidad.test.Pricing[pricingId=" + pricingId + "]";
|
||
}
|
||
|
||
/**
|
||
* @return the nombPricing
|
||
*/
|
||
public String getNombPricing() {
|
||
return nombPricing;
|
||
}
|
||
|
||
/**
|
||
* @param nombPricing
|
||
* the nombPricing to set
|
||
*/
|
||
public void setNombPricing(String nombPricing) {
|
||
this.nombPricing = nombPricing;
|
||
}
|
||
}
|