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

/**
 *
 * @author Administrador
 */
@Entity
@SequenceGenerator(name = "ZONA_SEQ", sequenceName = "ZONA_SEQ", allocationSize=1)
@Table(name = "ZONA")
public class Zona implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "ZONA_SEQ")
    @Column(name = "ZONA_ID")
    private Integer zonaId;
    @Column(name = "DESCZONA")
    private String desczona;
    @Column(name = "ACTIVO")
    private Short activo;
    @Column(name = "FECMODIF")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecmodif;
    @Column(name = "USUARIO_ID")
    private Integer usuarioId;
    @OneToMany(mappedBy = "zona")
    private List<Corrida> corridaList;

    public Zona() {
    }

    public Zona(Integer zonaId) {
        this.zonaId = zonaId;
    }

    public Integer getZonaId() {
        return zonaId;
    }

    public void setZonaId(Integer zonaId) {
        this.zonaId = zonaId;
    }

    public String getDesczona() {
        return desczona;
    }

    public void setDesczona(String desczona) {
        this.desczona = desczona;
    }

    public Short getActivo() {
        return activo;
    }

    public void setActivo(Short 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<Corrida> getCorridaList() {
        return corridaList;
    }

    public void setCorridaList(List<Corrida> corridaList) {
        this.corridaList = corridaList;
    }

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

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