rodrigo 2012-12-14 18:10:33 +00:00
parent d38115f948
commit ff42d2b4fb
1 changed files with 144 additions and 134 deletions

View File

@ -25,7 +25,7 @@ import javax.persistence.TemporalType;
import javax.persistence.SequenceGenerator; import javax.persistence.SequenceGenerator;
/** /**
* *
* @author Administrador * @author Administrador
*/ */
@Entity @Entity
@ -33,164 +33,174 @@ import javax.persistence.SequenceGenerator;
@Table(name = "CATEGORIA_DESCUENTO") @Table(name = "CATEGORIA_DESCUENTO")
public class CategoriaDescuento implements Serializable { public class CategoriaDescuento 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 = "CATEGORIA_DESCUENTO_SEQ") @GeneratedValue(strategy = GenerationType.AUTO, generator = "CATEGORIA_DESCUENTO_SEQ")
@Column(name = "CATEGORIADESCUENTO_ID") @Column(name = "CATEGORIADESCUENTO_ID")
private Integer categoriadescuentoId; private Integer categoriadescuentoId;
@Column(name = "CANTAUTORIZADA") @Column(name = "CANTAUTORIZADA")
private Integer cantautorizada; private Integer cantautorizada;
@Column(name = "DESCUENTOPORC") @Column(name = "DESCUENTOPORC")
private BigDecimal descuentoporc; private BigDecimal descuentoporc;
@Column(name = "DESCUENTOIMPORTE") @Column(name = "DESCUENTOIMPORTE")
private BigDecimal descuentoimporte; private BigDecimal descuentoimporte;
@Column(name = "ACTIVO") @Column(name = "ACTIVO")
private Boolean activo; private Boolean activo;
@Basic(optional = false) @Basic(optional = false)
@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 = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID") @JoinColumn(name = "CATEGORIACTRL_ID", referencedColumnName = "CATEGORIACTRL_ID")
@ManyToOne(cascade = CascadeType.ALL) @ManyToOne(cascade = CascadeType.ALL)
private CategoriaCtrl categoriaCtrl; private CategoriaCtrl categoriaCtrl;
@JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID") @JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID")
@ManyToOne @ManyToOne
private Categoria categoria; private Categoria categoria;
@OneToMany(mappedBy = "categoriaDescuento", cascade = CascadeType.ALL) @OneToMany(mappedBy = "categoriaDescuento", cascade = CascadeType.ALL)
private List<CategoriaPeriodo> categoriaPeriodoList; private List<CategoriaPeriodo> categoriaPeriodoList;
@Column(name = "INDIMPRIMEBOLETO")
private Boolean indImprimeBoleto;
public CategoriaDescuento() { public CategoriaDescuento() {
} }
public CategoriaDescuento(Integer categoriadescuentoId) { public CategoriaDescuento(Integer categoriadescuentoId) {
this.categoriadescuentoId = categoriadescuentoId; this.categoriadescuentoId = categoriadescuentoId;
} }
public CategoriaDescuento(Integer categoriadescuentoId, Date fecmodif) { public CategoriaDescuento(Integer categoriadescuentoId, Date fecmodif) {
this.categoriadescuentoId = categoriadescuentoId; this.categoriadescuentoId = categoriadescuentoId;
this.fecmodif = fecmodif; this.fecmodif = fecmodif;
} }
public Integer getCategoriadescuentoId() { public Integer getCategoriadescuentoId() {
return categoriadescuentoId; return categoriadescuentoId;
} }
public void setCategoriadescuentoId(Integer categoriadescuentoId) { public void setCategoriadescuentoId(Integer categoriadescuentoId) {
this.categoriadescuentoId = categoriadescuentoId; this.categoriadescuentoId = categoriadescuentoId;
} }
public Integer getCantautorizada() { public Integer getCantautorizada() {
return cantautorizada; return cantautorizada;
} }
public void setCantautorizada(Integer cantautorizada) { public void setCantautorizada(Integer cantautorizada) {
this.cantautorizada = cantautorizada; this.cantautorizada = cantautorizada;
} }
public BigDecimal getDescuentoporc() { public BigDecimal getDescuentoporc() {
return descuentoporc; return descuentoporc;
} }
public void setDescuentoporc(BigDecimal descuentoporc) { public void setDescuentoporc(BigDecimal descuentoporc) {
this.descuentoporc = descuentoporc; this.descuentoporc = descuentoporc;
} }
public BigDecimal getDescuentoimporte() { public BigDecimal getDescuentoimporte() {
return descuentoimporte; return descuentoimporte;
} }
public void setDescuentoimporte(BigDecimal descuentoimporte) { public void setDescuentoimporte(BigDecimal descuentoimporte) {
this.descuentoimporte = descuentoimporte; this.descuentoimporte = descuentoimporte;
} }
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 CategoriaCtrl getCategoriaCtrl() { public CategoriaCtrl getCategoriaCtrl() {
return categoriaCtrl; return categoriaCtrl;
} }
public void setCategoriaCtrl(CategoriaCtrl categoriaCtrl) { public void setCategoriaCtrl(CategoriaCtrl categoriaCtrl) {
this.categoriaCtrl = categoriaCtrl; this.categoriaCtrl = categoriaCtrl;
} }
public Categoria getCategoria() { public Categoria getCategoria() {
return categoria; return categoria;
} }
public void setCategoria(Categoria categoria) { public void setCategoria(Categoria categoria) {
this.categoria = categoria; this.categoria = categoria;
} }
public List<CategoriaPeriodo> getCategoriaPeriodoList() { public List<CategoriaPeriodo> getCategoriaPeriodoList() {
List<CategoriaPeriodo> tmp = new ArrayList<CategoriaPeriodo>(); List<CategoriaPeriodo> tmp = new ArrayList<CategoriaPeriodo>();
if (categoriaPeriodoList != null) { if (categoriaPeriodoList != null) {
for (CategoriaPeriodo cp : this.categoriaPeriodoList) { for (CategoriaPeriodo cp : this.categoriaPeriodoList) {
if (cp.getActivo()) { if (cp.getActivo()) {
tmp.add(cp); tmp.add(cp);
} }
} }
} }
return tmp; return tmp;
} }
public void setCategoriaPeriodoList(List<CategoriaPeriodo> categoriaPeriodoList) { public void setCategoriaPeriodoList(List<CategoriaPeriodo> categoriaPeriodoList) {
this.categoriaPeriodoList = categoriaPeriodoList; this.categoriaPeriodoList = categoriaPeriodoList;
} }
@Override public Boolean getIndImprimeBoleto() {
public boolean equals(Object obj) { return indImprimeBoleto;
if (obj == null) { }
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final CategoriaDescuento other = (CategoriaDescuento) obj;
if (this.categoriaCtrl != other.categoriaCtrl && (this.categoriaCtrl == null || !this.categoriaCtrl.equals(other.categoriaCtrl))) {
return false;
}
if (this.categoria != other.categoria && (this.categoria == null || !this.categoria.equals(other.categoria))) {
return false;
}
return true;
}
@Override public void setIndImprimeBoleto(Boolean indImprimeBoleto) {
public int hashCode() { this.indImprimeBoleto = indImprimeBoleto;
int hash = 7; }
hash = 53 * hash + (this.categoriaCtrl != null ? this.categoriaCtrl.hashCode() : 0);
hash = 53 * hash + (this.categoria != null ? this.categoria.hashCode() : 0);
return hash;
}
@Override @Override
public String toString() { public boolean equals(Object obj) {
return "com.rjconsultores.ventaboletos.entidad.CategoriaDescuento[categoriadescuentoId=" + categoriadescuentoId + "]"; if (obj == null) {
} return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final CategoriaDescuento other = (CategoriaDescuento) obj;
if (this.categoriaCtrl != other.categoriaCtrl && (this.categoriaCtrl == null || !this.categoriaCtrl.equals(other.categoriaCtrl))) {
return false;
}
if (this.categoria != other.categoria && (this.categoria == null || !this.categoria.equals(other.categoria))) {
return false;
}
return true;
}
@Override
public int hashCode() {
int hash = 7;
hash = 53 * hash + (this.categoriaCtrl != null ? this.categoriaCtrl.hashCode() : 0);
hash = 53 * hash + (this.categoria != null ? this.categoria.hashCode() : 0);
return hash;
}
@Override
public String toString() {
return "com.rjconsultores.ventaboletos.entidad.CategoriaDescuento[categoriadescuentoId=" + categoriadescuentoId + "]";
}
} }