package com.fitbank.hb.persistence.loc;

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

/**Clase que implementa la entidad de Hibernate que hace referencia a la tabla TPAISESRIESGO*/
public class Triskcountry extends AbstractExpire  implements Serializable,TransportBean,Cloneable{
/** Nombre de la Tabla TPAISESRIESGO */
public static final String TABLE_NAME = "TPAISESRIESGO";
/** HashCode asociado con la Instancia*/
private int hashValue = 0;
/** Version de la Clase*/
private static final long serialVersionUID = 1L;
/**
* Clave primaria de la Entidad Triskcountry
*/
private TriskcountryKey pk;
/**
* Fecha desde la que esta vigente la definicion del nivel de  riesgo
*/
private Timestamp fdesde;

/**
* Nivel de riesgo para Validacion de Cupo tiene 0,1 y 2. Para Validacion de cambio de clave o validacion de activacion en el pais de riesgo tendra 0 y 1
*/
private Integer nivelriesgo;

/**
* Manejo de optimistic loking
*/
private Integer versioncontrol;

/**Contructor por defecto*/
public Triskcountry(){}
/**Contructor de Triskcountry
@param pPk Clave Primaria del entity
@param pFdesde Fecha desde la que esta vigente la definicion del nivel de  riesgo
@param pNivelriesgo Nivel de riesgo para Validacion de Cupo tiene 0,1 y 2. Para Validacion de cambio de clave o validacion de activacion en el pais de riesgo tendra 0 y 1
*/
public Triskcountry(TriskcountryKey pPk,Timestamp pFdesde,Integer pNivelriesgo){
 pk=pPk;
 fdesde=pFdesde;
 nivelriesgo=pNivelriesgo;
}
/**Entrega la Clave primaria de Triskcountry
@return El objeto que referencia a la Clave primaria de Triskcountry
*/
public TriskcountryKey getPk(){
  return pk;
}
/**Fija un nuevo valor a la Clave primaria de Triskcountry
@param pPk El objeto que referencia a la nueva Clave primaria de Triskcountry
*/
public void setPk(TriskcountryKey pPk){
  pk=pPk;
}
public static final String FDESDE="FDESDE";
/**Obtiene el valor de fdesde
@return valor de fdesde*/
public Timestamp getFdesde(){
  return fdesde;
}
/**Fija el valor de fdesde
@param pFdesde nuevo Valor de fdesde*/
public void setFdesde(Timestamp pFdesde){
  fdesde=pFdesde;
}

public static final String NIVELRIESGO="NIVELRIESGO";
/**Obtiene el valor de nivelriesgo
@return valor de nivelriesgo*/
public Integer getNivelriesgo(){
  return nivelriesgo;
}
/**Fija el valor de nivelriesgo
@param pNivelriesgo nuevo Valor de nivelriesgo*/
public void setNivelriesgo(Integer pNivelriesgo){
  nivelriesgo=pNivelriesgo;
}

public static final String VERSIONCONTROL="VERSIONCONTROL";
/**Obtiene el valor de versioncontrol
@return valor de versioncontrol*/
public Integer getVersioncontrol(){
  return versioncontrol;
}
/**Fija el valor de versioncontrol
@param pVersioncontrol nuevo Valor de versioncontrol*/
public void setVersioncontrol(Integer pVersioncontrol){
  versioncontrol=pVersioncontrol;
}

/**Implementacion de la comparacion de la entidad Triskcountry
@param rhs Elemento de Comparacion
@return el resultado de la comparacion
*/
public boolean equals(Object rhs){
    if (rhs == null){return false;}
    if (! (rhs instanceof Triskcountry)){return false;}
    Triskcountry that = (Triskcountry) rhs;
    if (this.getPk() == null || that.getPk() == null){
        return false;}
    return (this.getPk().equals(that.getPk()));
}
/**Implementaci?n del metodo hashCode de la la entidad Triskcountry
@return el hashCode la instancia
*/
public int hashCode()    {
    if (this.hashValue == 0){
        int result = 17;
        if (this.getPk() == null){
            result = super.hashCode();
        }else{
            result = this.getPk().hashCode();
        }
        this.hashValue = result;
    }
    return this.hashValue;
}
/**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+=name+"="+f.get(this)+";";
	 }catch(Exception e){
		 continue;
	 }
		}
		if(data.compareTo("")==0){
		data=super.toString();
		}
	return data;
	}
/**Implementaci?n de la creaci?n de un bean en blancoTriskcountry
*/
public Object createInstance() throws Exception{
 Triskcountry instance=new Triskcountry();	
 instance.setPk(new TriskcountryKey());
 return instance;
}
public Object cloneMe() throws Exception{
  Triskcountry p=(Triskcountry)this.clone();
  p.setPk((TriskcountryKey)this.pk.cloneMe());
  return p;
}
public Object getId() {
  return this.pk;
}
}
