/*
 * 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 rodrigo
 */
@Entity
@SequenceGenerator(name = "PLAZA_SEQ", sequenceName = "PLAZA_SEQ", allocationSize=1)
@Table(name = "PLAZA")
public class Plaza implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "PLAZA_SEQ")
    @Column(name = "PLAZA_ID")
    private Integer plazaId;
    @Column(name = "NOMBPLAZA")
    private String nombplaza;
    @Column(name = "ACTIVO")
    private Boolean activo;
    @Column(name = "FECMODIF")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecmodif;
    @Column(name = "USUARIO_ID")
    private Integer usuarioId;

    public Plaza() {
    }

    public Plaza(Integer plazaId) {
        this.plazaId = plazaId;
    }

    public Integer getPlazaId() {
        return plazaId;
    }

    public void setPlazaId(Integer plazaId) {
        this.plazaId = plazaId;
    }

    public String getNombplaza() {
        return nombplaza;
    }

    public void setNombplaza(String nombplaza) {
        this.nombplaza = nombplaza;
    }

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

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