/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package conexionCredibanco.entity;

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.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author viatori
 */
@Entity
@Table(name = "ref_paises")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RefPaises.findAll", query = "SELECT r FROM RefPaises r")
    , @NamedQuery(name = "RefPaises.findByIdPaises", query = "SELECT r FROM RefPaises r WHERE r.idPaises = :idPaises")
    , @NamedQuery(name = "RefPaises.findByPais", query = "SELECT r FROM RefPaises r WHERE r.pais = :pais")
    , @NamedQuery(name = "RefPaises.findByEstado", query = "SELECT r FROM RefPaises r WHERE r.estado = :estado")
    , @NamedQuery(name = "RefPaises.findByCreated", query = "SELECT r FROM RefPaises r WHERE r.created = :created")
    , @NamedQuery(name = "RefPaises.findByUpdated", query = "SELECT r FROM RefPaises r WHERE r.updated = :updated")})
public class RefPaises implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_paises")
    private Long idPaises;
    @Basic(optional = false)
    @Column(name = "pais")
    private String pais;
    @Basic(optional = false)
    @Column(name = "estado")
    private boolean estado;
    @Basic(optional = false)
    @Column(name = "created")
    @Temporal(TemporalType.TIMESTAMP)
    private Date created;
    @Basic(optional = false)
    @Column(name = "updated")
    @Temporal(TemporalType.TIMESTAMP)
    private Date updated;
    @JoinColumn(name = "id_empresa", referencedColumnName = "id_empresa")
    @ManyToOne(optional = false)
    private TblEmpresasCredibanco idEmpresa;

    public RefPaises() {
    }

    public RefPaises(Long idPaises) {
        this.idPaises = idPaises;
    }

    public RefPaises(Long idPaises, String pais, boolean estado, Date created, Date updated) {
        this.idPaises = idPaises;
        this.pais = pais;
        this.estado = estado;
        this.created = created;
        this.updated = updated;
    }

    public Long getIdPaises() {
        return idPaises;
    }

    public void setIdPaises(Long idPaises) {
        this.idPaises = idPaises;
    }

    public String getPais() {
        return pais;
    }

    public void setPais(String pais) {
        this.pais = pais;
    }

    public boolean getEstado() {
        return estado;
    }

    public void setEstado(boolean estado) {
        this.estado = estado;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Date getUpdated() {
        return updated;
    }

    public void setUpdated(Date updated) {
        this.updated = updated;
    }

    public TblEmpresasCredibanco getIdEmpresa() {
        return idEmpresa;
    }

    public void setIdEmpresa(TblEmpresasCredibanco idEmpresa) {
        this.idEmpresa = idEmpresa;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPaises != null ? idPaises.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RefPaises)) {
            return false;
        }
        RefPaises other = (RefPaises) object;
        if ((this.idPaises == null && other.idPaises != null) || (this.idPaises != null && !this.idPaises.equals(other.idPaises))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "conexionCredibanco.entity.RefPaises[ idPaises=" + idPaises + " ]";
    }
    
}
