package com.fitbank.hb.persistence.quota;

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

/**Clase que hace referencia a la Clave Primaria de TCUOTAS*/
public class TquotaKey    implements Serializable,Cloneable{
/** Nombre de la Tabla TCUOTAS */
public static final String TABLE_NAME = "TCUOTAS";
/** HashCode asociado con la Instancia*/
private int hashValue = 0;
/** Version de la Clase*/
private static final long serialVersionUID = 1L;
/**
* Numero de cuenta de una cuota
*/
private String ccuenta;

/**
* Codigo de persona de la compania
*/
private Integer cpersona_compania;

/**
* Particin de la tabla de pags yyyymm  de la fecha de viegencia.
*/
private String fparticion;

/**
* Fecha hasta la cual esta vigente la tabla de pagos se cadua el  registro si cambia los valores de las cuotas.
*/
private Date fvigentehasta;

/**
* Numero de subcuenta o cuota.
*/
private Integer subcuenta;

/**Contructor por defecto*/
public TquotaKey(){}
/**Contructor de TquotaKey
@param pCcuenta Numero de cuenta de una cuota
@param pCpersona_compania Codigo de persona de la compania
@param pFparticion Particin de la tabla de pags yyyymm  de la fecha de viegencia.
@param pFvigentehasta Fecha hasta la cual esta vigente la tabla de pagos se cadua el  registro si cambia los valores de las cuotas.
@param pSubcuenta Numero de subcuenta o cuota.
*/
public TquotaKey(String pCcuenta,Integer pCpersona_compania,String pFparticion,Date pFvigentehasta,Integer pSubcuenta){
 ccuenta=pCcuenta;
 cpersona_compania=pCpersona_compania;
 fparticion=pFparticion;
 fvigentehasta=pFvigentehasta;
 subcuenta=pSubcuenta;
}
public static final String CCUENTA="CCUENTA";
/**Obtiene el valor de ccuenta
@return valor de ccuenta*/
public String getCcuenta(){
  return ccuenta;
}
/**Fija el valor de ccuenta
@param pCcuenta nuevo Valor de ccuenta*/
public void setCcuenta(String pCcuenta){
  ccuenta=pCcuenta;
}

public static final String CPERSONA_COMPANIA="CPERSONA_COMPANIA";
/**Obtiene el valor de cpersona_compania
@return valor de cpersona_compania*/
public Integer getCpersona_compania(){
  return cpersona_compania;
}
/**Fija el valor de cpersona_compania
@param pCpersona_compania nuevo Valor de cpersona_compania*/
public void setCpersona_compania(Integer pCpersona_compania){
  cpersona_compania=pCpersona_compania;
}

public static final String FPARTICION="FPARTICION";
/**Obtiene el valor de fparticion
@return valor de fparticion*/
public String getFparticion(){
  return fparticion;
}
/**Fija el valor de fparticion
@param pFparticion nuevo Valor de fparticion*/
public void setFparticion(String pFparticion){
  fparticion=pFparticion;
}

public static final String FVIGENTEHASTA="FVIGENTEHASTA";
/**Obtiene el valor de fvigentehasta
@return valor de fvigentehasta*/
public Date getFvigentehasta(){
  return fvigentehasta;
}
/**Fija el valor de fvigentehasta
@param pFvigentehasta nuevo Valor de fvigentehasta*/
public void setFvigentehasta(Date pFvigentehasta){
  fvigentehasta=pFvigentehasta;
}

public static final String SUBCUENTA="SUBCUENTA";
/**Obtiene el valor de subcuenta
@return valor de subcuenta*/
public Integer getSubcuenta(){
  return subcuenta;
}
/**Fija el valor de subcuenta
@param pSubcuenta nuevo Valor de subcuenta*/
public void setSubcuenta(Integer pSubcuenta){
  subcuenta=pSubcuenta;
}

public static final String PK_CCUENTA="CCUENTA";
public static final String PK_CPERSONA_COMPANIA="CPERSONA_COMPANIA";
public static final String PK_FPARTICION="FPARTICION";
public static final String PK_FVIGENTEHASTA="FVIGENTEHASTA";
public static final String PK_SUBCUENTA="SUBCUENTA";
/**Implementaci?n de la comparaci?n de TquotaKey
@param o Objeto de comparaci?n
*/
public boolean equals(Object o){
  if (o == null){return false;}
  if (! (o instanceof TquotaKey)){return false;}
  TquotaKey that = (TquotaKey) o;
  if (this.getCcuenta() == null || that.getCcuenta() == null){
      return false;
  }
  if (! this.getCcuenta().equals(that.getCcuenta())){
    return false;
  }
  if (this.getCpersona_compania() == null || that.getCpersona_compania() == null){
      return false;
  }
  if (! this.getCpersona_compania().equals(that.getCpersona_compania())){
    return false;
  }
  if (this.getFparticion() == null || that.getFparticion() == null){
      return false;
  }
  if (! this.getFparticion().equals(that.getFparticion())){
    return false;
  }
  if (this.getFvigentehasta() == null || that.getFvigentehasta() == null){
      return false;
  }
  if (! this.getFvigentehasta().equals(that.getFvigentehasta())){
    return false;
  }
  if (this.getSubcuenta() == null || that.getSubcuenta() == null){
      return false;
  }
  if (! this.getSubcuenta().equals(that.getSubcuenta())){
    return false;
  }
  return true;
}
/**Implementaci?n del m?todo hashCode bajo el patr?n de Bloch
@return hashCode de la instancia TquotaKey
*/
public int hashCode(){
  if (this.hashValue == 0){
    int result = 17;
    result = result * 37 + (this.getCcuenta() == null ? 0 : this.getCcuenta().hashCode());
    result = result * 37 + (this.getCpersona_compania() == null ? 0 : this.getCpersona_compania().hashCode());
    result = result * 37 + (this.getFparticion() == null ? 0 : this.getFparticion().hashCode());
    result = result * 37 + (this.getFvigentehasta() == null ? 0 : this.getFvigentehasta().hashCode());
    result = result * 37 + (this.getSubcuenta() == null ? 0 : this.getSubcuenta().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;
	}
}
