package com.fitbank.hb.persistence.loc;

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 TCANTONES*/
public class TcantonKey  extends AbstractExpire  implements Serializable,Cloneable,ManejaHistory{
/** Nombre de la Tabla TCANTONES */
public static final String TABLE_NAME = "TCANTONES";
/** HashCode asociado con la Instancia*/
private int hashValue = 0;
/** Version de la Clase*/
private static final long serialVersionUID = 1L;
/**
* Codigo del canton
*/
private String ccanton;

/**
* Codigo del pais
*/
private String cpais;

/**
* Codigo de la provincia
*/
private String cprovincia;

/**
* Codigo de idioma
*/
private String cidioma;

/**
* Fecha hasta la que esta vigente la descripcion de una ciudad
*/
private Timestamp fhasta;

/**Contructor por defecto*/
public TcantonKey(){}
/**Contructor de TcantonKey
@param pCcanton Codigo del canton
@param pCpais Codigo del pais
@param pCprovincia Codigo de la provincia
@param pCidioma Codigo de idioma
@param pFhasta Fecha hasta la que esta vigente la descripcion de una ciudad
*/
public TcantonKey(String pCcanton,String pCpais,String pCprovincia,String pCidioma,Timestamp pFhasta){
 ccanton=pCcanton;
 cpais=pCpais;
 cprovincia=pCprovincia;
 cidioma=pCidioma;
 fhasta=pFhasta;
}
public static final String CCANTON="CCANTON";
/**Obtiene el valor de ccanton
@return valor de ccanton*/
public String getCcanton(){
  return ccanton;
}
/**Fija el valor de ccanton
@param pCcanton nuevo Valor de ccanton*/
public void setCcanton(String pCcanton){
  ccanton=pCcanton;
}

public static final String CPAIS="CPAIS";
/**Obtiene el valor de cpais
@return valor de cpais*/
public String getCpais(){
  return cpais;
}
/**Fija el valor de cpais
@param pCpais nuevo Valor de cpais*/
public void setCpais(String pCpais){
  cpais=pCpais;
}

public static final String CPROVINCIA="CPROVINCIA";
/**Obtiene el valor de cprovincia
@return valor de cprovincia*/
public String getCprovincia(){
  return cprovincia;
}
/**Fija el valor de cprovincia
@param pCprovincia nuevo Valor de cprovincia*/
public void setCprovincia(String pCprovincia){
  cprovincia=pCprovincia;
}

public static final String CIDIOMA="CIDIOMA";
/**Obtiene el valor de cidioma
@return valor de cidioma*/
public String getCidioma(){
  return cidioma;
}
/**Fija el valor de cidioma
@param pCidioma nuevo Valor de cidioma*/
public void setCidioma(String pCidioma){
  cidioma=pCidioma;
}

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_CCANTON="CCANTON";
public static final String PK_CPAIS="CPAIS";
public static final String PK_CPROVINCIA="CPROVINCIA";
public static final String PK_CIDIOMA="CIDIOMA";
public static final String PK_FHASTA="FHASTA";
/**Implementaci?n de la comparaci?n de TcantonKey
@param o Objeto de comparaci?n
*/
public boolean equals(Object o){
  if (o == null){return false;}
  if (! (o instanceof TcantonKey)){return false;}
  TcantonKey that = (TcantonKey) o;
  if (this.getCcanton() == null || that.getCcanton() == null){
      return false;
  }
  if (! this.getCcanton().equals(that.getCcanton())){
    return false;
  }
  if (this.getCpais() == null || that.getCpais() == null){
      return false;
  }
  if (! this.getCpais().equals(that.getCpais())){
    return false;
  }
  if (this.getCprovincia() == null || that.getCprovincia() == null){
      return false;
  }
  if (! this.getCprovincia().equals(that.getCprovincia())){
    return false;
  }
  if (this.getCidioma() == null || that.getCidioma() == null){
      return false;
  }
  if (! this.getCidioma().equals(that.getCidioma())){
    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 TcantonKey
*/
public int hashCode(){
  if (this.hashValue == 0){
    int result = 17;
    result = result * 37 + (this.getCcanton() == null ? 0 : this.getCcanton().hashCode());
    result = result * 37 + (this.getCpais() == null ? 0 : this.getCpais().hashCode());
    result = result * 37 + (this.getCprovincia() == null ? 0 : this.getCprovincia().hashCode());
    result = result * 37 + (this.getCidioma() == null ? 0 : this.getCidioma().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;
}
}
