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

/**
 *
 * @author Desenvolvimento
 */
@Entity
@SequenceGenerator(name = "PTOVTAEMPCONBAN_SEQ", sequenceName = "PTOVTAEMPCONBAN_SEQ", allocationSize = 1)
@Table(name = "PTOVTA_EMPRESA_CONTABANCARIA")
public class PtovtaEmpresaContaBancaria implements Serializable {
    private static final long serialVersionUID = 1L;
    
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "PTOVTAEMPCONBAN_SEQ")
    @Column(name = "PTOVTAEMPRESACONTABANCARIA_ID")
    private Integer ptovtaEmpresaContaBancariaId;
    
    @JoinColumn(name = "PTOVTAEMPRESA_ID", referencedColumnName = "PTOVTAEMPRESA_ID")
    @ManyToOne
    private PtovtaEmpresa ptovtaEmpresa;
    
	@JoinColumn(name = "EMPRESACONTABANCARIA_ID", referencedColumnName = "EMPRESACONTABANCARIA_ID")
	@ManyToOne
	private EmpresaContaBancaria empresaContaBancaria;    
    
    @Column(name = "ACTIVO")
    private Boolean activo;
    
    @Column(name = "FECMODIF")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecmodif;
    
    @Column(name = "USUARIO_ID")
    private Integer usuarioId;

    public PtovtaEmpresaContaBancaria() {
    }

	public Integer getPtovtaEmpresaContaBancariaId() {
		return ptovtaEmpresaContaBancariaId;
	}

	public void setPtovtaEmpresaContaBancariaId(Integer ptovtaEmpresaContaBancariaId) {
		this.ptovtaEmpresaContaBancariaId = ptovtaEmpresaContaBancariaId;
	}

	public PtovtaEmpresa getPtovtaEmpresa() {
		return ptovtaEmpresa;
	}

	public void setPtovtaEmpresa(PtovtaEmpresa ptovtaEmpresa) {
		this.ptovtaEmpresa = ptovtaEmpresa;
	}

	public EmpresaContaBancaria getEmpresaContaBancaria() {
		return empresaContaBancaria;
	}

	public void setEmpresaContaBancaria(EmpresaContaBancaria empresaContaBancaria) {
		this.empresaContaBancaria = empresaContaBancaria;
	}

	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() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((ptovtaEmpresaContaBancariaId == null) ? 0 : ptovtaEmpresaContaBancariaId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PtovtaEmpresaContaBancaria other = (PtovtaEmpresaContaBancaria) obj;
		if (ptovtaEmpresaContaBancariaId == null) {
			if (other.ptovtaEmpresaContaBancariaId != null)
				return false;
		} else if (!ptovtaEmpresaContaBancariaId.equals(other.ptovtaEmpresaContaBancariaId))
			return false;
		return true;
	}

    @Override
    public String toString() {
        return "com.rjconsultores.ventaboletos.entidad.PtovtaEmpresaContaBancaria[ptovtaEmpresaContaBancariaId=" + ptovtaEmpresaContaBancariaId + "]";
    }
}