/*
 * 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 Shiro
 */
@Entity
@SequenceGenerator(name = "TIPO_CONVENIO_SEQ", sequenceName = "TIPO_CONVENIO_SEQ", allocationSize = 1)
@Table(name = "TIPO_CONVENIO")
public class TipoConvenio implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_CONVENIO_SEQ")
    @Column(name = "TIPOCONVENIO_ID")
    private Integer tipoConvenioID;
    @Column(name = "DESCTIPO")
    private String descTipo;
    @Column(name = "ACTIVO")
    private Boolean activo;
    @Column(name = "FECMODIF")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecmodif;
    @Column(name = "USUARIO_ID")
    private Integer usuarioId;
    @OneToMany(mappedBy = "tipoConvenio")
    private List<CuponConvenio> cuponConvenioList;

    public List<CuponConvenio> getCuponConvenioList() {
        return cuponConvenioList;
    }

    public void setCuponConvenioList(List<CuponConvenio> cuponConvenioList) {
        this.cuponConvenioList = cuponConvenioList;
    }

    public Boolean getActivo() {
        return activo;
    }

    public void setActivo(Boolean activo) {
        this.activo = activo;
    }

    public String getDescTipo() {
        return descTipo;
    }

    public void setDescTipo(String descTipo) {
        this.descTipo = descTipo;
    }

    public Date getFecmodif() {
        return fecmodif;
    }

    public void setFecmodif(Date fecmodif) {
        this.fecmodif = fecmodif;
    }

    public Integer getTipoConvenioID() {
        return tipoConvenioID;
    }

    public void setTipoConvenioID(Integer tipoConvenioID) {
        this.tipoConvenioID = tipoConvenioID;
    }

    public Integer getUsuarioId() {
        return usuarioId;
    }

    public void setUsuarioId(Integer usuarioId) {
        this.usuarioId = usuarioId;
    }

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

    @Override
    public String toString() {
        //return "com.rjconsultores.ventaboletos.entidad.Cortesia[cortesiaId=" + productoServicioID + "]";
        return this.getDescTipo();
    }
}
