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

/**
 *
 * @author Administrador
 */
@Entity
@SequenceGenerator(name = "NODO_SEQ", sequenceName = "NODO_SEQ", allocationSize=1)
@Table(name = "NODO")
public class Nodo implements Serializable {
	public static final Integer NODO_ID_CENTRAL = 1;

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "NODO_SEQ")
    @Basic(optional = false)
    @Column(name = "NODO_ID")
    private Integer nodoId;
    @Column(name = "DESCNODO")
    private String descnodo;
    @Column(name = "INDCONTINGENCIA")
    private Short indcontingencia;
    @Column(name = "DIRECCIONNODO")
    private String direccionnodo;
    @Column(name = "ACTIVO")
    private Boolean activo;
    @Column(name = "FECMODIF")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecmodif;
    @Column(name = "USUARIO_ID")
    private Integer usuarioId;

    public Nodo() {
    }

    public Nodo(Integer nodoId) {
        this.nodoId = nodoId;
    }

    public Integer getNodoId() {
        return nodoId;
    }

    public void setNodoId(Integer nodoId) {
        this.nodoId = nodoId;
    }

    public String getDescnodo() {
        return descnodo;
    }

    public void setDescnodo(String descnodo) {
        this.descnodo = descnodo;
    }

    public Short getIndcontingencia() {
        return indcontingencia;
    }

    public void setIndcontingencia(Short indcontingencia) {
        this.indcontingencia = indcontingencia;
    }

    public String getDireccionnodo() {
        return direccionnodo;
    }

    public void setDireccionnodo(String direccionnodo) {
        this.direccionnodo = direccionnodo;
    }

    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 += (nodoId != null ? nodoId.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 Nodo)) {
            return false;
        }
        Nodo other = (Nodo) object;
        if ((this.nodoId == null && other.nodoId != null) || (this.nodoId != null && !this.nodoId.equals(other.nodoId))) {
            return false;
        }
        return true;
    }

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