package com.fitbank.hb.persistence.accounting;

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

/**Clase que hace referencia a la Clave Primaria de TCOMPROBANTEDOCUMENTOS*/
public class TdocumentsvoucherKey  extends AbstractExpire  implements Serializable,Cloneable,ManejaHistory{
/** Nombre de la Tabla TCOMPROBANTEDOCUMENTOS */
public static final String TABLE_NAME = "TCOMPROBANTEDOCUMENTOS";
/** HashCode asociado con la Instancia*/
private int hashValue = 0;
/** Version de la Clase*/
private static final long serialVersionUID = 1L;
/**
* Codigo de persona beneficiario del comprobante.
*/
private Integer cpersona_beneficiario;

/**
* Codigo del tipo documento de facturacion
*/
private String ctipodocumentofacturacion;

/**
* Numero del documento
*/
private String numerodocumento;

/**
* Fecha hasta la que esta vigente el registro del comprobante de retecion emitido
*/
private Timestamp fhasta;

/**Contructor por defecto*/
public TdocumentsvoucherKey(){}
/**Contructor de TdocumentsvoucherKey
@param pCpersona_beneficiario Codigo de persona beneficiario del comprobante.
@param pCtipodocumentofacturacion Codigo del tipo documento de facturacion
@param pNumerodocumento Numero del documento
@param pFhasta Fecha hasta la que esta vigente el registro del comprobante de retecion emitido
*/
public TdocumentsvoucherKey(Integer pCpersona_beneficiario,String pCtipodocumentofacturacion,String pNumerodocumento,Timestamp pFhasta){
 cpersona_beneficiario=pCpersona_beneficiario;
 ctipodocumentofacturacion=pCtipodocumentofacturacion;
 numerodocumento=pNumerodocumento;
 fhasta=pFhasta;
}
public static final String CPERSONA_BENEFICIARIO="CPERSONA_BENEFICIARIO";
/**Obtiene el valor de cpersona_beneficiario
@return valor de cpersona_beneficiario*/
public Integer getCpersona_beneficiario(){
  return cpersona_beneficiario;
}
/**Fija el valor de cpersona_beneficiario
@param pCpersona_beneficiario nuevo Valor de cpersona_beneficiario*/
public void setCpersona_beneficiario(Integer pCpersona_beneficiario){
  cpersona_beneficiario=pCpersona_beneficiario;
}

public static final String CTIPODOCUMENTOFACTURACION="CTIPODOCUMENTOFACTURACION";
/**Obtiene el valor de ctipodocumentofacturacion
@return valor de ctipodocumentofacturacion*/
public String getCtipodocumentofacturacion(){
  return ctipodocumentofacturacion;
}
/**Fija el valor de ctipodocumentofacturacion
@param pCtipodocumentofacturacion nuevo Valor de ctipodocumentofacturacion*/
public void setCtipodocumentofacturacion(String pCtipodocumentofacturacion){
  ctipodocumentofacturacion=pCtipodocumentofacturacion;
}

public static final String NUMERODOCUMENTO="NUMERODOCUMENTO";
/**Obtiene el valor de numerodocumento
@return valor de numerodocumento*/
public String getNumerodocumento(){
  return numerodocumento;
}
/**Fija el valor de numerodocumento
@param pNumerodocumento nuevo Valor de numerodocumento*/
public void setNumerodocumento(String pNumerodocumento){
  numerodocumento=pNumerodocumento;
}

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_CPERSONA_BENEFICIARIO="CPERSONA_BENEFICIARIO";
public static final String PK_CTIPODOCUMENTOFACTURACION="CTIPODOCUMENTOFACTURACION";
public static final String PK_NUMERODOCUMENTO="NUMERODOCUMENTO";
public static final String PK_FHASTA="FHASTA";
/**Implementaci�n de la comparaci�n de TdocumentsvoucherKey
@param o Objeto de comparaciï¿½n
*/
public boolean equals(Object o){
  if (o == null){return false;}
  if (! (o instanceof TdocumentsvoucherKey)){return false;}
  TdocumentsvoucherKey that = (TdocumentsvoucherKey) o;
  if (this.getCpersona_beneficiario() == null || that.getCpersona_beneficiario() == null){
      return false;
  }
  if (! this.getCpersona_beneficiario().equals(that.getCpersona_beneficiario())){
    return false;
  }
  if (this.getCtipodocumentofacturacion() == null || that.getCtipodocumentofacturacion() == null){
      return false;
  }
  if (! this.getCtipodocumentofacturacion().equals(that.getCtipodocumentofacturacion())){
    return false;
  }
  if (this.getNumerodocumento() == null || that.getNumerodocumento() == null){
      return false;
  }
  if (! this.getNumerodocumento().equals(that.getNumerodocumento())){
    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 TdocumentsvoucherKey
*/
public int hashCode(){
  if (this.hashValue == 0){
    int result = 17;
    result = result * 37 + (this.getCpersona_beneficiario() == null ? 0 : this.getCpersona_beneficiario().hashCode());
    result = result * 37 + (this.getCtipodocumentofacturacion() == null ? 0 : this.getCtipodocumentofacturacion().hashCode());
    result = result * 37 + (this.getNumerodocumento() == null ? 0 : this.getNumerodocumento().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;
}
}
