/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rjconsultores.ventaboletos.entidad;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

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.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Administrador
 */
@Entity
@SequenceGenerator(name = "ARTICULO_SEQ", sequenceName = "ARTICULO_SEQ", allocationSize = 1)
@Table(name = "ARTICULO")
public class Articulo implements Serializable {

	public static final Integer TIPO_VENDA = 1;
	public static final Integer TIPO_OUTRO = 2;
	public static final Integer TIPO_VENDA_MANUAL = 3;
	
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "ARTICULO_SEQ")
    @Column(name = "ARTICULO_ID")
    private Integer articuloId;
    @Column(name = "DESCARTICULO")
    private String descarticulo;
    @Column(name = "EQUIVALENCIA_ID")
    private String equivalenciaId;
    @Column(name = "ACTIVO")
    private Boolean activo;
    @Column(name = "FECMODIF")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecmodif;
    @Column(name = "USUARIO_ID")
    private Integer usuarioId;
	@OneToMany(mappedBy = "articulo")
	private List<AbastoBoleto> abastoBoletoList;
	@OneToMany(mappedBy = "articulo")
	private List<RequisicionBoleto> requisicionBoletoList;
    @OneToOne(mappedBy = "articulo")
	private Clasificacion clasificacion;
    
    public Articulo() {
    }

    public Articulo(Integer articuloId) {
        this.articuloId = articuloId;
    }

    public Integer getArticuloId() {
        return articuloId;
    }

    public void setArticuloId(Integer articuloId) {
        this.articuloId = articuloId;
    }

    public String getDescarticulo() {
        return descarticulo;
    }

    public void setDescarticulo(String descarticulo) {
        this.descarticulo = descarticulo;
    }

    public String getEquivalenciaId() {
        return equivalenciaId;
    }

    public void setEquivalenciaId(String equivalenciaId) {
        this.equivalenciaId = equivalenciaId;
    }

    public Boolean getActivo() {
        return activo;
    }

    public void setActivo(Boolean activo) {
        this.activo = activo;
    }

    public Date getFecmodif() {
        return fecmodif;
    }

    public void setFecmodif(Date fecmodif) {
        this.fecmodif = fecmodif;
    }

    public Integer getUsuarioId() {
        return usuarioId;
    }

    public void setUsuarioId(Integer usuarioId) {
        this.usuarioId = usuarioId;
    }

	public List<AbastoBoleto> getAbastoBoletoList() {
		return abastoBoletoList;
	}

	public void setAbastoBoletoList(List<AbastoBoleto> abastoBoletoList) {
		this.abastoBoletoList = abastoBoletoList;
	}

	public List<RequisicionBoleto> getRequisicionBoletoList() {
		return requisicionBoletoList;
	}

	public void setRequisicionBoletoList(List<RequisicionBoleto> requisicionBoletoList) {
		this.requisicionBoletoList = requisicionBoletoList;
	}

	public Clasificacion getClasificacion() {
		return clasificacion;
	}

	public void setClasificacion(Clasificacion clasificacion) {
		this.clasificacion = clasificacion;
	}

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

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof Articulo)) {
            return false;
        }
        Articulo other = (Articulo) object;
        if ((this.articuloId == null && other.articuloId != null) || (this.articuloId != null && !this.articuloId.equals(other.articuloId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.rjconsultores.ventaboletos.entidad.Articulo[articuloId=" + articuloId + "]";
    }

}
