package com.fitbank.hb.persistence.lote;

import java.sql.Timestamp;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.sql.Date;

import com.fitbank.common.hb.AbstractExpire;
import com.fitbank.common.hb.ManejaHistory;

/** Clase que hace referencia a la Clave Primaria de TLOTECHEQUESRECIBIDOS */
public class TlotechecksreceivedKey extends AbstractExpire implements Serializable, Cloneable, ManejaHistory {
    /** Nombre de la Tabla TLOTECHEQUESRECIBIDOS */
    public static final String TABLE_NAME = "TLOTECHEQUESRECIBIDOS";

    /** HashCode asociado con la Instancia */
    private int hashValue = 0;

    /** Version de la Clase */
    private static final long serialVersionUID = 1L;

    /**
     * Fecha del lote de transacciones
     */
    private Date fechalote;

    /**
     * Numero del lote de transacciones a procesar
     */
    private Integer numerolote;

    /**
     * Codigo de ruta transito
     */
    private String rutatransito;

    /**
     * Cuenta duena del cheque
     */
    private String cuentagirada;

    /**
     * Fecha hasta de vigencia del registro
     */
    private Timestamp fhasta;

    /**
     * Numero del cheque
     */
    private Integer numerocheque;

    /** Contructor por defecto */
    public TlotechecksreceivedKey() {
    }

    /**
     * Contructor de TlotechecksreceivedKey
     * 
     * @param pFechalote Fecha del lote de transacciones
     * @param pNumerolote Numero del lote de transacciones a procesar
     * @param pRutatransito Codigo de ruta transito
     * @param pCuentagirada Cuenta duena del cheque
     * @param pFhasta Fecha hasta de vigencia del registro
     * @param pNumerocheque Numero del cheque
     */
    public TlotechecksreceivedKey(Date pFechalote, Integer pNumerolote, String pRutatransito, String pCuentagirada,
            Timestamp pFhasta, Integer pNumerocheque) {
        fechalote = pFechalote;
        numerolote = pNumerolote;
        rutatransito = pRutatransito;
        cuentagirada = pCuentagirada;
        fhasta = pFhasta;
        numerocheque = pNumerocheque;
    }

    public static final String FECHALOTE = "FECHALOTE";

    /**
     * Obtiene el valor de fechalote
     * 
     * @return valor de fechalote
     */
    public Date getFechalote() {
        return fechalote;
    }

    /**
     * Fija el valor de fechalote
     * 
     * @param pFechalote nuevo Valor de fechalote
     */
    public void setFechalote(Date pFechalote) {
        fechalote = pFechalote;
    }

    public static final String NUMEROLOTE = "NUMEROLOTE";

    /**
     * Obtiene el valor de numerolote
     * 
     * @return valor de numerolote
     */
    public Integer getNumerolote() {
        return numerolote;
    }

    /**
     * Fija el valor de numerolote
     * 
     * @param pNumerolote nuevo Valor de numerolote
     */
    public void setNumerolote(Integer pNumerolote) {
        numerolote = pNumerolote;
    }

    public static final String RUTATRANSITO = "RUTATRANSITO";

    /**
     * Obtiene el valor de rutatransito
     * 
     * @return valor de rutatransito
     */
    public String getRutatransito() {
        return rutatransito;
    }

    /**
     * Fija el valor de rutatransito
     * 
     * @param pRutatransito nuevo Valor de rutatransito
     */
    public void setRutatransito(String pRutatransito) {
        rutatransito = pRutatransito;
    }

    public static final String CUENTAGIRADA = "CUENTAGIRADA";

    /**
     * Obtiene el valor de cuentagirada
     * 
     * @return valor de cuentagirada
     */
    public String getCuentagirada() {
        return cuentagirada;
    }

    /**
     * Fija el valor de cuentagirada
     * 
     * @param pCuentagirada nuevo Valor de cuentagirada
     */
    public void setCuentagirada(String pCuentagirada) {
        cuentagirada = pCuentagirada;
    }

    public static final String FHASTA = "FHASTA";

    /**
     * Obtiene el valor de fhasta
     * 
     * @return valor de fhasta
     */
    public Timestamp getFhasta() {
        return fhasta;
    }

    /**
     * Fija el valor de fhasta
     * 
     * @param pFhasta nuevo Valor de fhasta
     */
    public void setFhasta(Timestamp pFhasta) {
        fhasta = pFhasta;
    }

    public static final String NUMEROCHEQUE = "NUMEROCHEQUE";

    /**
     * Obtiene el valor de numerocheque
     * 
     * @return valor de numerocheque
     */
    public Integer getNumerocheque() {
        return numerocheque;
    }

    /**
     * Fija el valor de numerocheque
     * 
     * @param pNumerocheque nuevo Valor de numerocheque
     */
    public void setNumerocheque(Integer pNumerocheque) {
        numerocheque = pNumerocheque;
    }

    public static final String PK_FECHALOTE = "FECHALOTE";

    public static final String PK_NUMEROLOTE = "NUMEROLOTE";

    public static final String PK_RUTATRANSITO = "RUTATRANSITO";

    public static final String PK_CUENTAGIRADA = "CUENTAGIRADA";

    public static final String PK_FHASTA = "FHASTA";

    public static final String PK_NUMEROCHEQUE = "NUMEROCHEQUE";

    /**
     * Implementaciï¿½n de la comparaciï¿½n de TlotechecksreceivedKey
     * 
     * @param o Objeto de comparaciÃ¯Â¿Â½n
     */
    public boolean equals(Object o) {
        if (o == null) {
            return false;
        }
        if (!(o instanceof TlotechecksreceivedKey)) {
            return false;
        }
        TlotechecksreceivedKey that = (TlotechecksreceivedKey) o;
        if (this.getFechalote() == null || that.getFechalote() == null) {
            return false;
        }
        if (!this.getFechalote().equals(that.getFechalote())) {
            return false;
        }
        if (this.getNumerolote() == null || that.getNumerolote() == null) {
            return false;
        }
        if (!this.getNumerolote().equals(that.getNumerolote())) {
            return false;
        }
        if (this.getRutatransito() == null || that.getRutatransito() == null) {
            return false;
        }
        if (!this.getRutatransito().equals(that.getRutatransito())) {
            return false;
        }
        if (this.getCuentagirada() == null || that.getCuentagirada() == null) {
            return false;
        }
        if (!this.getCuentagirada().equals(that.getCuentagirada())) {
            return false;
        }
        if (this.getFhasta() == null || that.getFhasta() == null) {
            return false;
        }
        if (!this.getFhasta().equals(that.getFhasta())) {
            return false;
        }
        if (this.getNumerocheque() == null || that.getNumerocheque() == null) {
            return false;
        }
        if (!this.getNumerocheque().equals(that.getNumerocheque())) {
            return false;
        }
        return true;
    }

    /**
     * Implementaciï¿½n del mï¿½todo hashCode bajo el patrï¿½n de Bloch
     * 
     * @return hashCode de la instancia TlotechecksreceivedKey
     */
    public int hashCode() {
        if (this.hashValue == 0) {
            int result = 17;
            result = result * 37 + (this.getFechalote() == null ? 0 : this.getFechalote().hashCode());
            result = result * 37 + (this.getNumerolote() == null ? 0 : this.getNumerolote().hashCode());
            result = result * 37 + (this.getRutatransito() == null ? 0 : this.getRutatransito().hashCode());
            result = result * 37 + (this.getCuentagirada() == null ? 0 : this.getCuentagirada().hashCode());
            result = result * 37 + (this.getFhasta() == null ? 0 : this.getFhasta().hashCode());
            result = result * 37 + (this.getNumerocheque() == null ? 0 : this.getNumerocheque().hashCode());
            this.hashValue = result;
        }
        return this.hashValue;
    }

    public Object cloneMe() throws Exception {
        return this.clone();
    }

    /** Implementaciï¿½n toString */
    public String toString() {
        Field[] fs = this.getClass().getDeclaredFields();
        String data = "";
        for (Field f : fs) {
            try {
                String name = f.getName();
                if (name.compareTo("hashValue") == 0 || name.compareTo("serialVersionUID") == 0) {
                    continue;
                }
                data += "pk." + name + "=" + f.get(this) + ";";
            } catch (Exception e) {
                continue;
            }
        }
        if (data.compareTo("") == 0) {
            data = super.toString();
        }
        return data;
    }

    public Object getId() {
        return null;
    }
}
