package com.fitbank.hb.persistence.uci;

import com.fitbank.common.hb.AbstractExpire;
import java.io.Serializable;
import java.lang.reflect.Field;
import com.fitbank.common.hb.ManejaHistory;
import java.sql.Timestamp;

/**Clase que hace referencia a la Clave Primaria de TEMISORBINES*/
public class TtransmitterbinKey  extends AbstractExpire  implements Serializable,Cloneable,ManejaHistory{
/** Nombre de la Tabla TEMISORBINES */
public static final String TABLE_NAME = "TEMISORBINES";
/** HashCode asociado con la Instancia*/
private int hashValue = 0;
/** Version de la Clase*/
private static final long serialVersionUID = 1L;
/**
* Codigo del emisor de tarjeta de debito o credito que se asocia a un bin
*/
private Integer cpersona_emisor;

/**
* Numero del BIN que constituye los seis primeros digitos del numero de tarjeta de debito
*/
private Integer numerobin;

/**
* Fecha hasta la que esta vigente el bin de un emisor
*/
private Timestamp fhasta;

/**Contructor por defecto*/
public TtransmitterbinKey(){}
/**Contructor de TtransmitterbinKey
@param pCpersona_emisor Codigo del emisor de tarjeta de debito o credito que se asocia a un bin
@param pNumerobin Numero del BIN que constituye los seis primeros digitos del numero de tarjeta de debito
@param pFhasta Fecha hasta la que esta vigente el bin de un emisor
*/
public TtransmitterbinKey(Integer pCpersona_emisor,Integer pNumerobin,Timestamp pFhasta){
 cpersona_emisor=pCpersona_emisor;
 numerobin=pNumerobin;
 fhasta=pFhasta;
}
public static final String CPERSONA_EMISOR="CPERSONA_EMISOR";
/**Obtiene el valor de cpersona_emisor
@return valor de cpersona_emisor*/
public Integer getCpersona_emisor(){
  return cpersona_emisor;
}
/**Fija el valor de cpersona_emisor
@param pCpersona_emisor nuevo Valor de cpersona_emisor*/
public void setCpersona_emisor(Integer pCpersona_emisor){
  cpersona_emisor=pCpersona_emisor;
}

public static final String NUMEROBIN="NUMEROBIN";
/**Obtiene el valor de numerobin
@return valor de numerobin*/
public Integer getNumerobin(){
  return numerobin;
}
/**Fija el valor de numerobin
@param pNumerobin nuevo Valor de numerobin*/
public void setNumerobin(Integer pNumerobin){
  numerobin=pNumerobin;
}

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 PK_CPERSONA_EMISOR="CPERSONA_EMISOR";
public static final String PK_NUMEROBIN="NUMEROBIN";
public static final String PK_FHASTA="FHASTA";
/**Implementaci?n de la comparaci?n de TtransmitterbinKey
@param o Objeto de comparaci?n
*/
public boolean equals(Object o){
  if (o == null){return false;}
  if (! (o instanceof TtransmitterbinKey)){return false;}
  TtransmitterbinKey that = (TtransmitterbinKey) o;
  if (this.getCpersona_emisor() == null || that.getCpersona_emisor() == null){
      return false;
  }
  if (! this.getCpersona_emisor().equals(that.getCpersona_emisor())){
    return false;
  }
  if (this.getNumerobin() == null || that.getNumerobin() == null){
      return false;
  }
  if (! this.getNumerobin().equals(that.getNumerobin())){
    return false;
  }
  if (this.getFhasta() == null || that.getFhasta() == null){
      return false;
  }
  if (! this.getFhasta().equals(that.getFhasta())){
    return false;
  }
  return true;
}
/**Implementaci?n del m?todo hashCode bajo el patr?n de Bloch
@return hashCode de la instancia TtransmitterbinKey
*/
public int hashCode(){
  if (this.hashValue == 0){
    int result = 17;
    result = result * 37 + (this.getCpersona_emisor() == null ? 0 : this.getCpersona_emisor().hashCode());
    result = result * 37 + (this.getNumerobin() == null ? 0 : this.getNumerobin().hashCode());
    result = result * 37 + (this.getFhasta() == null ? 0 : this.getFhasta().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;
}
}
