/*
 * 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.CascadeType;
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 Rafael
 */
@Entity
@SequenceGenerator(name = "INSTI_FINANCEIRA_SEQ", sequenceName = "INSTI_FINANCEIRA_SEQ", allocationSize = 1)
@Table(name = "INSTI_FINANCEIRA")

public class InstiFinanceira implements Serializable {
 
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "INSTI_FINANCEIRA_SEQ")
    @Column(name = "INSTIFINANCEIRA_ID")
    private Integer instFinanceiraId;
    
    @Column(name = "NOME")
    private String nome;
    
    @Column(name = "USUARIO_ID")
    private Integer usuarioId;
    
    @Column(name = "CODIGO")
    private String codigo;
    
    @Column(name = "ACTIVO")
    private Boolean activo;

    @Column(name = "FECMODIF")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecmodif;
    
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "instiFinanceiraId")
    private List<PtovtaAgencia> ptovtaAgenciaList;

    public InstiFinanceira() {
    }

    public InstiFinanceira(Integer instFinanceiraId) {
        this.instFinanceiraId = instFinanceiraId;
    }

    public InstiFinanceira(Integer instFinanceiraId, String codigo, String nome, Boolean activo, Date fecmodif, int usuarioId) {
        this.instFinanceiraId = instFinanceiraId;
        this.codigo = codigo;
        this.nome = nome;
        this.activo = activo;
        this.fecmodif = fecmodif;
        this.usuarioId = usuarioId;
    }

   

    public Integer getInstFinanceiraId() {
		return instFinanceiraId;
	}

	public void setInstFinanceiraId(Integer instFinanceiraId) {
		this.instFinanceiraId = instFinanceiraId;
	}

	public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    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 int getUsuarioId() {
        return usuarioId;
    }

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

    public List<PtovtaAgencia> getPtovtaAgenciaList() {
        return ptovtaAgenciaList;
    }

    public void setPtovtaAgenciaList(List<PtovtaAgencia> ptovtaAgenciaList) {
        this.ptovtaAgenciaList = ptovtaAgenciaList;
    }
    
    public String getCodigo() {
        return codigo;
    }

    public void setCodigo(String codigo) {
        this.codigo = codigo;
    }

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

    @Override
    public String toString() {
        return this.nome;
    }
    
}
