package com.fitbank.hb.persistence.person;

import java.io.Serializable;
import java.lang.reflect.Field;

/**Clase que hace referencia a la Clave Primaria de TACTIVIDADESID*/
public class TactivityidKey    implements Serializable,Cloneable{
/** Nombre de la Tabla TACTIVIDADESID */
public static final String TABLE_NAME = "TACTIVIDADESID";
/** HashCode asociado con la Instancia*/
private int hashValue = 0;
/** Version de la Clase*/
private static final long serialVersionUID = 1L;
/**
* Codigo del tipo de persona
*/
private String ctipopersona;

/**
* Codigo de actividad
*/
private String cactividad;

/**Contructor por defecto*/
public TactivityidKey(){}
/**Contructor de TactivityidKey
@param pCtipopersona Codigo del tipo de persona
@param pCactividad Codigo de actividad
*/
public TactivityidKey(String pCtipopersona,String pCactividad){
 ctipopersona=pCtipopersona;
 cactividad=pCactividad;
}
public static final String CTIPOPERSONA="CTIPOPERSONA";
/**Obtiene el valor de ctipopersona
@return valor de ctipopersona*/
public String getCtipopersona(){
  return ctipopersona;
}
/**Fija el valor de ctipopersona
@param pCtipopersona nuevo Valor de ctipopersona*/
public void setCtipopersona(String pCtipopersona){
  ctipopersona=pCtipopersona;
}

public static final String CACTIVIDAD="CACTIVIDAD";
/**Obtiene el valor de cactividad
@return valor de cactividad*/
public String getCactividad(){
  return cactividad;
}
/**Fija el valor de cactividad
@param pCactividad nuevo Valor de cactividad*/
public void setCactividad(String pCactividad){
  cactividad=pCactividad;
}

public static final String PK_CTIPOPERSONA="CTIPOPERSONA";
public static final String PK_CACTIVIDAD="CACTIVIDAD";
/**Implementaci�n de la comparaci�n de TactivityidKey
@param o Objeto de comparaciï¿½n
*/
public boolean equals(Object o){
  if (o == null){return false;}
  if (! (o instanceof TactivityidKey)){return false;}
  TactivityidKey that = (TactivityidKey) o;
  if (this.getCtipopersona() == null || that.getCtipopersona() == null){
      return false;
  }
  if (! this.getCtipopersona().equals(that.getCtipopersona())){
    return false;
  }
  if (this.getCactividad() == null || that.getCactividad() == null){
      return false;
  }
  if (! this.getCactividad().equals(that.getCactividad())){
    return false;
  }
  return true;
}
/**Implementaci�n del m�todo hashCode bajo el patr�n de Bloch
@return hashCode de la instancia TactivityidKey
*/
public int hashCode(){
  if (this.hashValue == 0){
    int result = 17;
    result = result * 37 + (this.getCtipopersona() == null ? 0 : this.getCtipopersona().hashCode());
    result = result * 37 + (this.getCactividad() == null ? 0 : this.getCactividad().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;
	}
}
