/*
 * 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.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;

/**
 *
 * @author Administrador
 */
@Entity
@SequenceGenerator(name = "REDONDEO_SEQ", sequenceName = "REDONDEO_SEQ", allocationSize = 1)
@Table(name = "REDONDEO")
public class Redondeo implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "REDONDEO_SEQ")
    @Basic(optional = false)
    @Column(name = "REDONDEO_ID")
    private Integer redondeoId;
    @Column(name = "VALORINICIAL")
    private BigDecimal valorinicial;
    @Column(name = "VALORFINAL")
    private BigDecimal valorfinal;
    @Column(name = "VALORREDONDEO")
    private BigDecimal valorredondeo;
    @Column(name = "ACTIVO")
    private Boolean activo;
    @Column(name = "FECMODIF")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecmodif;
    @Column(name = "USUARIO_ID")
    private Integer usuarioId;
    @JoinColumn(name = "REDONDEOCTRL_ID", referencedColumnName = "REDONDEOCTRL_ID")
    @ManyToOne
    private RedondeoCtrl redondeoCtrl;

    public Redondeo() {
    }

    public Redondeo(Integer redondeoId) {
        this.redondeoId = redondeoId;
    }

    public Integer getRedondeoId() {
        return redondeoId;
    }

    public void setRedondeoId(Integer redondeoId) {
        this.redondeoId = redondeoId;
    }

    public BigDecimal getValorinicial() {
        return valorinicial;
    }

    public void setValorinicial(BigDecimal valorinicial) {
        this.valorinicial = valorinicial;
    }

    public BigDecimal getValorfinal() {
        return valorfinal;
    }

    public void setValorfinal(BigDecimal valorfinal) {
        this.valorfinal = valorfinal;
    }

    public BigDecimal getValorredondeo() {
        return valorredondeo;
    }

    public void setValorredondeo(BigDecimal valorredondeo) {
        this.valorredondeo = valorredondeo;
    }

    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 RedondeoCtrl getRedondeoCtrl() {
        return redondeoCtrl;
    }

    public void setRedondeoCtrl(RedondeoCtrl redondeoCtrl) {
        this.redondeoCtrl = redondeoCtrl;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Redondeo other = (Redondeo) obj;
        if (this.valorinicial != other.valorinicial && (this.valorinicial == null || !this.valorinicial.equals(other.valorinicial))) {
            return false;
        }
        if (this.valorfinal != other.valorfinal && (this.valorfinal == null || !this.valorfinal.equals(other.valorfinal))) {
            return false;
        }
        if (this.valorredondeo != other.valorredondeo && (this.valorredondeo == null || !this.valorredondeo.equals(other.valorredondeo))) {
            return false;
        }
        if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) {
            return false;
        }
        if (this.redondeoCtrl != other.redondeoCtrl && (this.redondeoCtrl == null || !this.redondeoCtrl.equals(other.redondeoCtrl))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 41 * hash + (this.valorinicial != null ? this.valorinicial.hashCode() : 0);
        hash = 41 * hash + (this.valorfinal != null ? this.valorfinal.hashCode() : 0);
        hash = 41 * hash + (this.valorredondeo != null ? this.valorredondeo.hashCode() : 0);
        hash = 41 * hash + (this.activo != null ? this.activo.hashCode() : 0);
        hash = 41 * hash + (this.redondeoCtrl != null ? this.redondeoCtrl.hashCode() : 0);
        return hash;
    }

 
    @Override
    public String toString() {
        return "com.rjconsultores.ventaboletos.entidad.Redondeo[redondeoId=" + redondeoId + "]";
    }
}
