/*
 * 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.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * @author obper
 */
@Entity
@Table(name = "generales")
@XmlRootElement
@NamedQueries({
        @NamedQuery(name = "Generales.findAll", query = "SELECT g FROM Generales g"),
        @NamedQuery(name = "Generales.findByCodArticulo", query = "SELECT g FROM Generales g WHERE g.codArticulo = :codArticulo"),
        @NamedQuery(name = "Generales.findByClasTreb", query = "SELECT g FROM Generales g WHERE g.clasTreb = :clasTreb"),
        @NamedQuery(name = "Generales.findByPreTreb", query = "SELECT g FROM Generales g WHERE g.preTreb = :preTreb"),
        @NamedQuery(name = "Generales.findByPreProg", query = "SELECT g FROM Generales g WHERE g.preProg = :preProg"),
        @NamedQuery(name = "Generales.findByOfert", query = "SELECT g FROM Generales g WHERE g.ofert = :ofert"),
        @NamedQuery(name = "Generales.findByDescuento", query = "SELECT g FROM Generales g WHERE g.descuento = :descuento"),
        @NamedQuery(name = "Generales.findByNotaRemision", query = "SELECT g FROM Generales g WHERE g.notaRemision = :notaRemision"),
        @NamedQuery(name = "Generales.findByValorImperia", query = "SELECT g FROM Generales g WHERE g.valorImperia = :valorImperia"),
        @NamedQuery(name = "Generales.findByDerecho", query = "SELECT g FROM Generales g WHERE g.derecho = :derecho"),
        @NamedQuery(name = "Generales.findByCorrelativoAutorizacionCredito", query = "SELECT g FROM Generales g WHERE g.correlativoAutorizacionCredito = :correlativoAutorizacionCredito"),
        @NamedQuery(name = "Generales.findByNotaAbono", query = "SELECT g FROM Generales g WHERE g.notaAbono = :notaAbono"),
        @NamedQuery(name = "Generales.findByPrograma", query = "SELECT g FROM Generales g WHERE g.programa = :programa"),
        @NamedQuery(name = "Generales.findByCorrelativoNotaCargo", query = "SELECT g FROM Generales g WHERE g.correlativoNotaCargo = :correlativoNotaCargo"),
        @NamedQuery(name = "Generales.findByCambiarTerritorio", query = "SELECT g FROM Generales g WHERE g.cambiarTerritorio = :cambiarTerritorio"),
        @NamedQuery(name = "Generales.findByP0", query = "SELECT g FROM Generales g WHERE g.p0 = :p0"),
        @NamedQuery(name = "Generales.findByP1", query = "SELECT g FROM Generales g WHERE g.p1 = :p1"),
        @NamedQuery(name = "Generales.findByP2", query = "SELECT g FROM Generales g WHERE g.p2 = :p2"),
        @NamedQuery(name = "Generales.findByP3", query = "SELECT g FROM Generales g WHERE g.p3 = :p3"),
        @NamedQuery(name = "Generales.findByP4", query = "SELECT g FROM Generales g WHERE g.p4 = :p4"),
        @NamedQuery(name = "Generales.findByP5", query = "SELECT g FROM Generales g WHERE g.p5 = :p5"),
        @NamedQuery(name = "Generales.findByP6", query = "SELECT g FROM Generales g WHERE g.p6 = :p6"),
        @NamedQuery(name = "Generales.findByCorrelativoUsuario", query = "SELECT g FROM Generales g WHERE g.correlativoUsuario = :correlativoUsuario"),
        @NamedQuery(name = "Generales.findByCierre", query = "SELECT g FROM Generales g WHERE g.cierre = :cierre"),
        @NamedQuery(name = "Generales.findByLimiteReparto", query = "SELECT g FROM Generales g WHERE g.limiteReparto = :limiteReparto"),
        @NamedQuery(name = "Generales.findByCambio", query = "SELECT g FROM Generales g WHERE g.cambio = :cambio"),
        @NamedQuery(name = "Generales.findByImpresor", query = "SELECT g FROM Generales g WHERE g.impresor = :impresor"),
        @NamedQuery(name = "Generales.findByError", query = "SELECT g FROM Generales g WHERE g.error = :error"),
        @NamedQuery(name = "Generales.findByProducto", query = "SELECT g FROM Generales g WHERE g.producto = :producto"),
        @NamedQuery(name = "Generales.findByPrecio", query = "SELECT g FROM Generales g WHERE g.precio = :precio"),
        @NamedQuery(name = "Generales.findByPrimerPedido", query = "SELECT g FROM Generales g WHERE g.primerPedido = :primerPedido"),
        @NamedQuery(name = "Generales.findByDiaspremio", query = "SELECT g FROM Generales g WHERE g.diaspremio = :diaspremio")})
public class Generales implements Serializable {
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 4)
    @Column(name = "cod_articulo")
    private String codArticulo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2)
    @Column(name = "clas_treb")
    private String clasTreb;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "pre_treb")
    private String preTreb;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 3)
    @Column(name = "pre_prog")
    private String preProg;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 4)
    @Column(name = "ofert")
    private String ofert;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @NotNull
    @Column(name = "descuento")
    private BigDecimal descuento;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 6)
    @Column(name = "nota_remision")
    private String notaRemision;
    @Basic(optional = false)
    @NotNull
    @Column(name = "valor_imperia")
    private BigDecimal valorImperia;
    @Basic(optional = false)
    @NotNull
    @Column(name = "derecho")
    private short derecho;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 4)
    @Column(name = "correlativo_autorizacion_credito")
    private String correlativoAutorizacionCredito;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 6)
    @Column(name = "nota_abono")
    private String notaAbono;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 3)
    @Column(name = "programa")
    private String programa;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 6)
    @Column(name = "correlativo_nota_cargo")
    private String correlativoNotaCargo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 6)
    @Column(name = "cambiar_territorio")
    private String cambiarTerritorio;
    @Basic(optional = false)
    @NotNull
    @Column(name = "p0")
    private BigDecimal p0;
    @Basic(optional = false)
    @NotNull
    @Column(name = "p1")
    private BigDecimal p1;
    @Basic(optional = false)
    @NotNull
    @Column(name = "p2")
    private BigDecimal p2;
    @Basic(optional = false)
    @NotNull
    @Column(name = "p3")
    private BigDecimal p3;
    @Basic(optional = false)
    @NotNull
    @Column(name = "p4")
    private BigDecimal p4;
    @Basic(optional = false)
    @NotNull
    @Column(name = "p5")
    private BigDecimal p5;
    @Basic(optional = false)
    @NotNull
    @Column(name = "p6")
    private BigDecimal p6;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 3)
    @Column(name = "correlativo_usuario")
    private String correlativoUsuario;
    @Basic(optional = false)
    @NotNull
    @Column(name = "cierre")
    private boolean cierre;
    @Basic(optional = false)
    @NotNull
    @Column(name = "limite_reparto")
    private BigDecimal limiteReparto;
    @Basic(optional = false)
    @NotNull
    @Column(name = "cambio")
    private boolean cambio;
    @Basic(optional = false)
    @NotNull
    @Column(name = "impresor")
    @Temporal(TemporalType.DATE)
    private Date impresor;
    @Basic(optional = false)
    @NotNull
    @Column(name = "error")
    private boolean error;
    @Size(max = 5)
    @Column(name = "producto")
    private String producto;
    @Basic(optional = false)
    @NotNull
    @Column(name = "precio")
    private BigDecimal precio;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 4)
    @Column(name = "primer_pedido")
    private String primerPedido;
    @Basic(optional = false)
    @NotNull
    @Column(name = "diaspremio")
    private int diaspremio;
    @Column(name = "serie_fiscal")
    private String serieFiscal;

    public Generales() {
    }

    public Generales(String programa) {
        this.programa = programa;
    }

    public Generales(String programa, String codArticulo, String clasTreb, String preTreb, String preProg, String ofert, BigDecimal descuento, String notaRemision, BigDecimal valorImperia, short derecho, String correlativoAutorizacionCredito, String notaAbono, String correlativoNotaCargo, String cambiarTerritorio, BigDecimal p0, BigDecimal p1, BigDecimal p2, BigDecimal p3, BigDecimal p4, BigDecimal p5, BigDecimal p6, String correlativoUsuario, boolean cierre, BigDecimal limiteReparto, boolean cambio, Date impresor, boolean error, BigDecimal precio, String primerPedido, int diaspremio) {
        this.programa = programa;
        this.codArticulo = codArticulo;
        this.clasTreb = clasTreb;
        this.preTreb = preTreb;
        this.preProg = preProg;
        this.ofert = ofert;
        this.descuento = descuento;
        this.notaRemision = notaRemision;
        this.valorImperia = valorImperia;
        this.derecho = derecho;
        this.correlativoAutorizacionCredito = correlativoAutorizacionCredito;
        this.notaAbono = notaAbono;
        this.correlativoNotaCargo = correlativoNotaCargo;
        this.cambiarTerritorio = cambiarTerritorio;
        this.p0 = p0;
        this.p1 = p1;
        this.p2 = p2;
        this.p3 = p3;
        this.p4 = p4;
        this.p5 = p5;
        this.p6 = p6;
        this.correlativoUsuario = correlativoUsuario;
        this.cierre = cierre;
        this.limiteReparto = limiteReparto;
        this.cambio = cambio;
        this.impresor = impresor;
        this.error = error;
        this.precio = precio;
        this.primerPedido = primerPedido;
        this.diaspremio = diaspremio;
    }

    public String getSerieFiscal() {
        return serieFiscal;
    }

    public void setSerieFiscal(String serieFiscal) {
        this.serieFiscal = serieFiscal;
    }

    public String getCodArticulo() {
        return codArticulo;
    }

    public void setCodArticulo(String codArticulo) {
        this.codArticulo = codArticulo;
    }

    public String getClasTreb() {
        return clasTreb;
    }

    public void setClasTreb(String clasTreb) {
        this.clasTreb = clasTreb;
    }

    public String getPreTreb() {
        return preTreb;
    }

    public void setPreTreb(String preTreb) {
        this.preTreb = preTreb;
    }

    public String getPreProg() {
        return preProg;
    }

    public void setPreProg(String preProg) {
        this.preProg = preProg;
    }

    public String getOfert() {
        return ofert;
    }

    public void setOfert(String ofert) {
        this.ofert = ofert;
    }

    public BigDecimal getDescuento() {
        return descuento;
    }

    public void setDescuento(BigDecimal descuento) {
        this.descuento = descuento;
    }

    public String getNotaRemision() {
        return notaRemision;
    }

    public void setNotaRemision(String notaRemision) {
        this.notaRemision = notaRemision;
    }

    public BigDecimal getValorImperia() {
        return valorImperia;
    }

    public void setValorImperia(BigDecimal valorImperia) {
        this.valorImperia = valorImperia;
    }

    public short getDerecho() {
        return derecho;
    }

    public void setDerecho(short derecho) {
        this.derecho = derecho;
    }

    public String getCorrelativoAutorizacionCredito() {
        return correlativoAutorizacionCredito;
    }

    public void setCorrelativoAutorizacionCredito(String correlativoAutorizacionCredito) {
        this.correlativoAutorizacionCredito = correlativoAutorizacionCredito;
    }

    public String getNotaAbono() {
        return notaAbono;
    }

    public void setNotaAbono(String notaAbono) {
        this.notaAbono = notaAbono;
    }

    public String getPrograma() {
        return programa;
    }

    public void setPrograma(String programa) {
        this.programa = programa;
    }

    public String getCorrelativoNotaCargo() {
        return correlativoNotaCargo;
    }

    public void setCorrelativoNotaCargo(String correlativoNotaCargo) {
        this.correlativoNotaCargo = correlativoNotaCargo;
    }

    public String getCambiarTerritorio() {
        return cambiarTerritorio;
    }

    public void setCambiarTerritorio(String cambiarTerritorio) {
        this.cambiarTerritorio = cambiarTerritorio;
    }

    public BigDecimal getP0() {
        return p0;
    }

    public void setP0(BigDecimal p0) {
        this.p0 = p0;
    }

    public BigDecimal getP1() {
        return p1;
    }

    public void setP1(BigDecimal p1) {
        this.p1 = p1;
    }

    public BigDecimal getP2() {
        return p2;
    }

    public void setP2(BigDecimal p2) {
        this.p2 = p2;
    }

    public BigDecimal getP3() {
        return p3;
    }

    public void setP3(BigDecimal p3) {
        this.p3 = p3;
    }

    public BigDecimal getP4() {
        return p4;
    }

    public void setP4(BigDecimal p4) {
        this.p4 = p4;
    }

    public BigDecimal getP5() {
        return p5;
    }

    public void setP5(BigDecimal p5) {
        this.p5 = p5;
    }

    public BigDecimal getP6() {
        return p6;
    }

    public void setP6(BigDecimal p6) {
        this.p6 = p6;
    }

    public String getCorrelativoUsuario() {
        return correlativoUsuario;
    }

    public void setCorrelativoUsuario(String correlativoUsuario) {
        this.correlativoUsuario = correlativoUsuario;
    }

    public boolean getCierre() {
        return cierre;
    }

    public void setCierre(boolean cierre) {
        this.cierre = cierre;
    }

    public BigDecimal getLimiteReparto() {
        return limiteReparto;
    }

    public void setLimiteReparto(BigDecimal limiteReparto) {
        this.limiteReparto = limiteReparto;
    }

    public boolean getCambio() {
        return cambio;
    }

    public void setCambio(boolean cambio) {
        this.cambio = cambio;
    }

    public Date getImpresor() {
        return impresor;
    }

    public void setImpresor(Date impresor) {
        this.impresor = impresor;
    }

    public boolean getError() {
        return error;
    }

    public void setError(boolean error) {
        this.error = error;
    }

    public String getProducto() {
        return producto;
    }

    public void setProducto(String producto) {
        this.producto = producto;
    }

    public BigDecimal getPrecio() {
        return precio;
    }

    public void setPrecio(BigDecimal precio) {
        this.precio = precio;
    }

    public String getPrimerPedido() {
        return primerPedido;
    }

    public void setPrimerPedido(String primerPedido) {
        this.primerPedido = primerPedido;
    }

    public int getDiaspremio() {
        return diaspremio;
    }

    public void setDiaspremio(int diaspremio) {
        this.diaspremio = diaspremio;
    }

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

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

}
