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

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

/**
 * @author obper
 */
@Entity
@Table(name = "bitacoras_web")
@XmlRootElement
@NamedQueries({
        @NamedQuery(name = "BitacorasWeb.findAll", query = "SELECT b FROM BitacorasWeb b"),
        @NamedQuery(name = "BitacorasWeb.findByUsuarioCodigo", query = "SELECT b FROM BitacorasWeb b WHERE b.usuarioCodigo = :usuarioCodigo"),
        @NamedQuery(name = "BitacorasWeb.findById", query = "SELECT b FROM BitacorasWeb b WHERE b.id = :id"),
        @NamedQuery(name = "BitacorasWeb.findByModulo", query = "SELECT b FROM BitacorasWeb b WHERE b.modulo = :modulo"),
        @NamedQuery(name = "BitacorasWeb.findByFecha", query = "SELECT b FROM BitacorasWeb b WHERE b.fecha = :fecha"),
        @NamedQuery(name = "BitacorasWeb.findByFechasRagon", query = "SELECT b FROM BitacorasWeb b WHERE b.fecha BETWEEN :fechaIn AND :fechaOut"),
        @NamedQuery(name = "BitacorasWeb.findByHost", query = "SELECT b FROM BitacorasWeb b WHERE b.host = :host"),
        @NamedQuery(name = "BitacorasWeb.findByDescripcion", query = "SELECT b FROM BitacorasWeb b WHERE b.descripcion = :descripcion"),
        @NamedQuery(name = "BitacorasWeb.findByAccion", query = "SELECT b FROM BitacorasWeb b WHERE b.accion = :accion")})
public class BitacorasWeb implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 200)
    @Column(name = "modulo")
    private String modulo;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecha")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "host")
    private String host;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "descripcion")
    private String descripcion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "accion")
    private String accion;
    @Size(min = 3)
    @Column(name = "usuario_codigo")
    private String usuarioCodigo;

    public BitacorasWeb() {
    }

    public BitacorasWeb(Integer id) {
        this.id = id;
    }

    public BitacorasWeb(Integer id, String modulo, Date fecha, String host, String descripcion, String accion) {
        this.id = id;
        this.modulo = modulo;
        this.fecha = fecha;
        this.host = host;
        this.descripcion = descripcion;
        this.accion = accion;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getModulo() {
        return modulo;
    }

    public void setModulo(String modulo) {
        this.modulo = modulo;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getAccion() {
        return accion;
    }

    public void setAccion(String accion) {
        this.accion = accion;
    }

    public String getUsuarioCodigo() {
        return usuarioCodigo;
    }

    public void setUsuarioCodigo(String usuarioCodigo) {
        this.usuarioCodigo = usuarioCodigo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        // hash += (id != null ? id.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 BitacorasWeb)) {
            return false;
        }
        BitacorasWeb other = (BitacorasWeb) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.cosmodas.dbcon.BitacorasWeb[ id=" + id + " ]";
    }

}
