package com.fitbank.hb.persistence.gene;

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

/**
* Codigo del tipo de prestamo
*/
private String ctipoprestamo;

/**
* Codigo de la operacion de credito
*/
private String ccodigooperacion;

/**
* Codigo del tipo de persona
*/
private String ctipopersona;

/**
* Fecha hasta la que esta vigente la definicion del segmento de credito
*/
private Timestamp fhasta;

/**Contructor por defecto*/
public TsegmentcreditdefinitionKey(){}
/**Contructor de TsegmentcreditdefinitionKey
@param pCsegmentocredito Codigo del segmento de credito
@param pCtipoprestamo Codigo del tipo de prestamo
@param pCcodigooperacion Codigo de la operacion de credito
@param pCtipopersona Codigo del tipo de persona
@param pFhasta Fecha hasta la que esta vigente la definicion del segmento de credito
*/
public TsegmentcreditdefinitionKey(Integer pCsegmentocredito,String pCtipoprestamo,String pCcodigooperacion,String pCtipopersona,Timestamp pFhasta){
 csegmentocredito=pCsegmentocredito;
 ctipoprestamo=pCtipoprestamo;
 ccodigooperacion=pCcodigooperacion;
 ctipopersona=pCtipopersona;
 fhasta=pFhasta;
}
public static final String CSEGMENTOCREDITO="CSEGMENTOCREDITO";
/**Obtiene el valor de csegmentocredito
@return valor de csegmentocredito*/
public Integer getCsegmentocredito(){
  return csegmentocredito;
}
/**Fija el valor de csegmentocredito
@param pCsegmentocredito nuevo Valor de csegmentocredito*/
public void setCsegmentocredito(Integer pCsegmentocredito){
  csegmentocredito=pCsegmentocredito;
}

public static final String CTIPOPRESTAMO="CTIPOPRESTAMO";
/**Obtiene el valor de ctipoprestamo
@return valor de ctipoprestamo*/
public String getCtipoprestamo(){
  return ctipoprestamo;
}
/**Fija el valor de ctipoprestamo
@param pCtipoprestamo nuevo Valor de ctipoprestamo*/
public void setCtipoprestamo(String pCtipoprestamo){
  ctipoprestamo=pCtipoprestamo;
}

public static final String CCODIGOOPERACION="CCODIGOOPERACION";
/**Obtiene el valor de ccodigooperacion
@return valor de ccodigooperacion*/
public String getCcodigooperacion(){
  return ccodigooperacion;
}
/**Fija el valor de ccodigooperacion
@param pCcodigooperacion nuevo Valor de ccodigooperacion*/
public void setCcodigooperacion(String pCcodigooperacion){
  ccodigooperacion=pCcodigooperacion;
}

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 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_CSEGMENTOCREDITO="CSEGMENTOCREDITO";
public static final String PK_CTIPOPRESTAMO="CTIPOPRESTAMO";
public static final String PK_CCODIGOOPERACION="CCODIGOOPERACION";
public static final String PK_CTIPOPERSONA="CTIPOPERSONA";
public static final String PK_FHASTA="FHASTA";
/**Implementaci?n de la comparaci?n de TsegmentcreditdefinitionKey
@param o Objeto de comparaci?n
*/
public boolean equals(Object o){
  if (o == null){return false;}
  if (! (o instanceof TsegmentcreditdefinitionKey)){return false;}
  TsegmentcreditdefinitionKey that = (TsegmentcreditdefinitionKey) o;
  if (this.getCsegmentocredito() == null || that.getCsegmentocredito() == null){
      return false;
  }
  if (! this.getCsegmentocredito().equals(that.getCsegmentocredito())){
    return false;
  }
  if (this.getCtipoprestamo() == null || that.getCtipoprestamo() == null){
      return false;
  }
  if (! this.getCtipoprestamo().equals(that.getCtipoprestamo())){
    return false;
  }
  if (this.getCcodigooperacion() == null || that.getCcodigooperacion() == null){
      return false;
  }
  if (! this.getCcodigooperacion().equals(that.getCcodigooperacion())){
    return false;
  }
  if (this.getCtipopersona() == null || that.getCtipopersona() == null){
      return false;
  }
  if (! this.getCtipopersona().equals(that.getCtipopersona())){
    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 TsegmentcreditdefinitionKey
*/
public int hashCode(){
  if (this.hashValue == 0){
    int result = 17;
    result = result * 37 + (this.getCsegmentocredito() == null ? 0 : this.getCsegmentocredito().hashCode());
    result = result * 37 + (this.getCtipoprestamo() == null ? 0 : this.getCtipoprestamo().hashCode());
    result = result * 37 + (this.getCcodigooperacion() == null ? 0 : this.getCcodigooperacion().hashCode());
    result = result * 37 + (this.getCtipopersona() == null ? 0 : this.getCtipopersona().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;
}
}
