/*
 * 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_horarios")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RefHorarios.findAll", query = "SELECT r FROM RefHorarios r")
    , @NamedQuery(name = "RefHorarios.findByIdHorario", query = "SELECT r FROM RefHorarios r WHERE r.idHorario = :idHorario")
    , @NamedQuery(name = "RefHorarios.findByDias", query = "SELECT r FROM RefHorarios r WHERE r.dias = :dias")
    , @NamedQuery(name = "RefHorarios.findByHoraInicio", query = "SELECT r FROM RefHorarios r WHERE r.horaInicio = :horaInicio")
    , @NamedQuery(name = "RefHorarios.findByHoraFin", query = "SELECT r FROM RefHorarios r WHERE r.horaFin = :horaFin")
    , @NamedQuery(name = "RefHorarios.findByEstado", query = "SELECT r FROM RefHorarios r WHERE r.estado = :estado")
    , @NamedQuery(name = "RefHorarios.findByCreated", query = "SELECT r FROM RefHorarios r WHERE r.created = :created")
    , @NamedQuery(name = "RefHorarios.findByUpdated", query = "SELECT r FROM RefHorarios r WHERE r.updated = :updated")})
public class RefHorarios implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_horario")
    private Long idHorario;
    @Basic(optional = false)
    @Column(name = "dias")
    private String dias;
    @Basic(optional = false)
    @Column(name = "hora_inicio")
    @Temporal(TemporalType.TIME)
    private Date horaInicio;
    @Basic(optional = false)
    @Column(name = "hora_fin")
    @Temporal(TemporalType.TIME)
    private Date horaFin;
    @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 RefHorarios() {
    }

    public RefHorarios(Long idHorario) {
        this.idHorario = idHorario;
    }

    public RefHorarios(Long idHorario, String dias, Date horaInicio, Date horaFin, boolean estado, Date created, Date updated) {
        this.idHorario = idHorario;
        this.dias = dias;
        this.horaInicio = horaInicio;
        this.horaFin = horaFin;
        this.estado = estado;
        this.created = created;
        this.updated = updated;
    }

    public Long getIdHorario() {
        return idHorario;
    }

    public void setIdHorario(Long idHorario) {
        this.idHorario = idHorario;
    }

    public String getDias() {
        return dias;
    }

    public void setDias(String dias) {
        this.dias = dias;
    }

    public Date getHoraInicio() {
        return horaInicio;
    }

    public void setHoraInicio(Date horaInicio) {
        this.horaInicio = horaInicio;
    }

    public Date getHoraFin() {
        return horaFin;
    }

    public void setHoraFin(Date horaFin) {
        this.horaFin = horaFin;
    }

    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 += (idHorario != null ? idHorario.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 RefHorarios)) {
            return false;
        }
        RefHorarios other = (RefHorarios) object;
        if ((this.idHorario == null && other.idHorario != null) || (this.idHorario != null && !this.idHorario.equals(other.idHorario))) {
            return false;
        }
        return true;
    }

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