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

/**
 *
 * @author Rafius
 */
@Entity
@SequenceGenerator(name = "TIPO_VENTA_SEQ", sequenceName = "TIPO_VENTA_SEQ", allocationSize=1)
@Table(name = "TIPO_VENTA")
public class TipoVenta implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_VENTA_SEQ")
    @Column(name = "TIPOVENTA_ID")
    private Short tipoventaId;
    @Column(name = "DESCTIPOVENTA")
    private String desctipoventa;
    @Column(name = "ACTIVO")
    private Boolean activo;
    @Column(name = "FECMODIF")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecmodif;
    @Column(name = "USUARIO_ID")
    private Integer usuarioId;

    public TipoVenta() {
    }

    public TipoVenta(Short tipoventaId) {
        this.tipoventaId = tipoventaId;
    }

    public Short getTipoventaId() {
        return tipoventaId;
    }

    public void setTipoventaId(Short tipoventaId) {
        this.tipoventaId = tipoventaId;
    }

    public String getDesctipoventa() {
        return desctipoventa;
    }

    public void setDesctipoventa(String desctipoventa) {
        this.desctipoventa = desctipoventa;
    }

    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;
    }

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

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

    @Override
    public String toString() {
        return getDesctipoventa();
    }
}
