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

/**
 *
 * @author Rafius
 */
@Entity
@SequenceGenerator(name = "MERCHANT_BANCARIO_SEQ", sequenceName = "MERCHANT_BANCARIO_SEQ", allocationSize = 1)
@Table(name = "MERCHANT_BANCARIO")
public class MerchantBancario implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "MERCHANT_BANCARIO_SEQ")
    @Column(name = "MERCHANTBANCARIO_ID")
    private Integer merchantbancarioId;
    @Column(name = "CVEMERCHANT")
    private String cvemerchant;
    @Column(name = "DESCMERCHANT")
    private String descmerchant;
    @Column(name = "USUARIO_ID")
    private Integer usuarioId;
    @Column(name = "FECMODIF")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecmodif;
    @Basic(optional = false)
    @Column(name = "ACTIVO")
    private Boolean activo;
    @JoinColumn(name = "COMPANIABANCARIA_ID", referencedColumnName = "COMPANIABANCARIA_ID")
    @ManyToOne(optional = false)
    private CompaniaBancaria companiaBancaria;

    public MerchantBancario() {
    }

    public MerchantBancario(Integer merchantbancarioId) {
        this.merchantbancarioId = merchantbancarioId;
    }

    public MerchantBancario(Integer merchantbancarioId, Boolean activo) {
        this.merchantbancarioId = merchantbancarioId;
        this.activo = activo;
    }

    public Integer getMerchantbancarioId() {
        return merchantbancarioId;
    }

    public void setMerchantbancarioId(Integer merchantbancarioId) {
        this.merchantbancarioId = merchantbancarioId;
    }

    public String getCvemerchant() {
        return cvemerchant;
    }

    public void setCvemerchant(String cvemerchant) {
        this.cvemerchant = cvemerchant;
    }

    public String getDescmerchant() {
        return descmerchant;
    }

    public void setDescmerchant(String descmerchant) {
        this.descmerchant = descmerchant;
    }

    public Integer getUsuarioId() {
        return usuarioId;
    }

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

    public Date getFecmodif() {
        return fecmodif;
    }

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

    public Boolean getActivo() {
        return activo;
    }

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

    public CompaniaBancaria getCompaniaBancaria() {
        return companiaBancaria;
    }

    public void setCompaniaBancaria(CompaniaBancaria companiaBancaria) {
        this.companiaBancaria = companiaBancaria;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final MerchantBancario other = (MerchantBancario) obj;
        if ((this.cvemerchant == null) ? (other.cvemerchant != null) : !this.cvemerchant.equals(other.cvemerchant)) {
            return false;
        }
        if ((this.descmerchant == null) ? (other.descmerchant != null) : !this.descmerchant.equals(other.descmerchant)) {
            return false;
        }
        if (this.activo != other.activo && (this.activo == null || !this.activo.equals(other.activo))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 53 * hash + (this.cvemerchant != null ? this.cvemerchant.hashCode() : 0);
        hash = 53 * hash + (this.descmerchant != null ? this.descmerchant.hashCode() : 0);
        hash = 53 * hash + (this.activo != null ? this.activo.hashCode() : 0);
        return hash;
    }

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