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

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "SISTEMA_SEQ")
    @Column(name = "SISTEMA_ID")
    private Integer sistemaId;
    @Column(name = "NOMBSISTEMA")
    private String nombsistema;
    @Column(name = "ACTIVO")
    private Boolean activo;
    @Column(name = "FECMODIF")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecmodif;
    @Column(name = "USUARIO_ID")
    private Integer usuarioId;
    @OneToMany(mappedBy = "sistema")
    private List<FuncionSistema> funcionSistemaList;

    public Sistema() {
    }

    public Sistema(Integer sistemaId) {
        this.sistemaId = sistemaId;
    }

    public Integer getSistemaId() {
        return sistemaId;
    }

    public void setSistemaId(Integer sistemaId) {
        this.sistemaId = sistemaId;
    }

    public String getNombsistema() {
        return nombsistema;
    }

    public void setNombsistema(String nombsistema) {
        this.nombsistema = nombsistema;
    }

    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<FuncionSistema> getFuncionSistemaList() {
        return funcionSistemaList;
    }

    public void setFuncionSistemaList(List<FuncionSistema> funcionSistemaList) {
        this.funcionSistemaList = funcionSistemaList;
    }

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

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