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.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author valdir.cordeiro
 */
@Entity
@SequenceGenerator(name = "REDONDEO_ORGAOCONCEDENTE_SEQ", sequenceName = "REDONDEO_ORGAOCONCEDENTE_SEQ", allocationSize = 1)
@Table(name = "REDONDEO_ORGAOCONCEDENTE")
public class RedondeoOrgaoConcedente implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "REDONDEO_ORGAOCONCEDENTE_SEQ")
    @Basic(optional = false)
    @Column(name = "REDONDEOORGAOCONCEDENTE_ID")
    private Long redondeoOrgaoConcedenteId;
    
    @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;
   
    @OneToOne
    @JoinColumn(name = "ORGAOCONCEDENTE_ID")
    private OrgaoConcedente orgaoConcedente;

    public RedondeoOrgaoConcedente() {
    }

    public RedondeoOrgaoConcedente(Long redondeoOrgaoConcedenteId) {
        this.redondeoOrgaoConcedenteId = redondeoOrgaoConcedenteId;
    }

    public Long getRedondeoOrgaoConcedenteId() {
        return redondeoOrgaoConcedenteId;
    }

    public void setRedondeoOrgaoConcedenteId(Long redondeoOrgaoConcedenteId) {
        this.redondeoOrgaoConcedenteId = redondeoOrgaoConcedenteId;
    }

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

    public OrgaoConcedente getOrgaoConcedente() {
        return orgaoConcedente;
    }

    public void setOrgaoConcedente(OrgaoConcedente orgaoConcedente) {
        this.orgaoConcedente = orgaoConcedente;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final RedondeoOrgaoConcedente other = (RedondeoOrgaoConcedente) obj;
        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;
        }
        if (this.orgaoConcedente != other.orgaoConcedente && (this.orgaoConcedente == null || !this.orgaoConcedente.equals(other.orgaoConcedente))) {
            return false;
        }
        return true;
    }

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


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