/*
 * 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.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.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * @author obper
 */
@Entity
@Table(name = "articulos_zonas_total")
@XmlRootElement
@NamedQueries({
        @NamedQuery(name = "ArticulosZonasTotal.findAll", query = "SELECT a FROM ArticulosZonasTotal a"),
        @NamedQuery(name = "ArticulosZonasTotal.findByZona", query = "SELECT a FROM ArticulosZonasTotal a WHERE a.zona = :zona"),
        @NamedQuery(name = "ArticulosZonasTotal.findBySucursalAndArticuloCodigo", query = "SELECT a FROM ArticulosZonasTotal a WHERE a.sucursalCodigo = :sucursalCodigo AND a.articuloCodigo = :articuloCodigo"),
        @NamedQuery(name = "ArticulosZonasTotal.findByCantidad", query = "SELECT a FROM ArticulosZonasTotal a WHERE a.cantidad = :cantidad"),
        @NamedQuery(name = "ArticulosZonasTotal.findByCajas", query = "SELECT a FROM ArticulosZonasTotal a WHERE a.cajas = :cajas"),
        @NamedQuery(name = "ArticulosZonasTotal.findByFecha", query = "SELECT a FROM ArticulosZonasTotal a WHERE a.fecha = :fecha"),
        @NamedQuery(name = "ArticulosZonasTotal.findByObservacion", query = "SELECT a FROM ArticulosZonasTotal a WHERE a.observacion = :observacion"),
        @NamedQuery(name = "ArticulosZonasTotal.findByIdzone", query = "SELECT a FROM ArticulosZonasTotal a WHERE a.idzone = :idzone"),
        @NamedQuery(name = "ArticulosZonasTotal.findByFingreso", query = "SELECT a FROM ArticulosZonasTotal a WHERE a.fingreso = :fingreso"),
        @NamedQuery(name = "ArticulosZonasTotal.findBySucursalCodigo", query = "SELECT a FROM ArticulosZonasTotal a WHERE a.sucursalCodigo = :sucursalCodigo"),
        @NamedQuery(name = "ArticulosZonasTotal.findBySinTablet", query = "SELECT a FROM ArticulosZonasTotal a WHERE a.sinTablet = :sinTablet"),
        @NamedQuery(name = "ArticulosZonasTotal.findByIdzonetablet", query = "SELECT a FROM ArticulosZonasTotal a WHERE a.idzonetablet = :idzonetablet")})
public class ArticulosZonasTotal implements Serializable {
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2)
    @Column(name = "zona")
    private String zona;
    @Basic(optional = false)
    @NotNull
    @Column(name = "cantidad")
    private short cantidad;
    @Basic(optional = false)
    @NotNull
    @Column(name = "cajas")
    private short cajas;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 14)
    @Column(name = "fecha")
    private String fecha;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "observacion")
    private String observacion;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idzone")
    private Integer idzone;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fingreso")
    @Temporal(TemporalType.DATE)
    private Date fingreso;
    @Basic(optional = false)
    @NotNull
    @Column(name = "sucursal_codigo")
    private int sucursalCodigo;
    @Basic(optional = false)
    @NotNull
    @Column(name = "sin_tablet")
    private boolean sinTablet;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idzonetablet")
    private int idzonetablet;
    @Size(max = 3)
    @Column(name = "usuario_codigo")
    private String usuarioCodigo;
    ;
    @JoinColumn(name = "articulo_codigo", referencedColumnName = "articulo_codigo")
    @ManyToOne(optional = false)
    private Articulo articuloCodigo;

    public ArticulosZonasTotal() {
    }

    public ArticulosZonasTotal(Integer idzone) {
        this.idzone = idzone;
    }

    public ArticulosZonasTotal(Integer idzone, String zona, short cantidad, short cajas, String fecha, String observacion, Date fingreso, int sucursalCodigo, boolean sinTablet, int idzonetablet) {
        this.idzone = idzone;
        this.zona = zona;
        this.cantidad = cantidad;
        this.cajas = cajas;
        this.fecha = fecha;
        this.observacion = observacion;
        this.fingreso = fingreso;
        this.sucursalCodigo = sucursalCodigo;
        this.sinTablet = sinTablet;
        this.idzonetablet = idzonetablet;
    }

    public String getZona() {
        return zona;
    }

    public void setZona(String zona) {
        this.zona = zona;
    }

    public short getCantidad() {
        return cantidad;
    }

    public void setCantidad(short cantidad) {
        this.cantidad = cantidad;
    }

    public short getCajas() {
        return cajas;
    }

    public void setCajas(short cajas) {
        this.cajas = cajas;
    }

    public String getFecha() {
        return fecha;
    }

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

    public String getObservacion() {
        return observacion;
    }

    public void setObservacion(String observacion) {
        this.observacion = observacion;
    }

    public Integer getIdzone() {
        return idzone;
    }

    public void setIdzone(Integer idzone) {
        this.idzone = idzone;
    }

    public Date getFingreso() {
        return fingreso;
    }

    public void setFingreso(Date fingreso) {
        this.fingreso = fingreso;
    }

    public int getSucursalCodigo() {
        return sucursalCodigo;
    }

    public void setSucursalCodigo(int sucursalCodigo) {
        this.sucursalCodigo = sucursalCodigo;
    }

    public boolean getSinTablet() {
        return sinTablet;
    }

    public void setSinTablet(boolean sinTablet) {
        this.sinTablet = sinTablet;
    }

    public int getIdzonetablet() {
        return idzonetablet;
    }

    public void setIdzonetablet(int idzonetablet) {
        this.idzonetablet = idzonetablet;
    }

    public String getUsuarioCodigo() {
        return usuarioCodigo;
    }

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

    public Articulo getArticuloCodigo() {
        return articuloCodigo;
    }

    public void setArticuloCodigo(Articulo articuloCodigo) {
        this.articuloCodigo = articuloCodigo;
    }

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

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

}
