package com.fitbank.hb.persistence.fin;

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

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

/**
* Secuencia de transaccion para el numero de mensaje
*/
private Integer stransaccion;

/**
* yyyyymm de la fecha contable del movimiento 
*/
private String particion;

/**Contructor por defecto*/
public TmovementKey(){}
/**Contructor de TmovementKey
@param pNumeromensaje Numero de mensaje
@param pStransaccion Secuencia de transaccion para el numero de mensaje
@param pParticion yyyyymm de la fecha contable del movimiento 
*/
public TmovementKey(String pNumeromensaje,Integer pStransaccion,String pParticion){
 numeromensaje=pNumeromensaje;
 stransaccion=pStransaccion;
 particion=pParticion;
}
public static final String NUMEROMENSAJE="NUMEROMENSAJE";
/**Obtiene el valor de numeromensaje
@return valor de numeromensaje*/
public String getNumeromensaje(){
  return numeromensaje;
}
/**Fija el valor de numeromensaje
@param pNumeromensaje nuevo Valor de numeromensaje*/
public void setNumeromensaje(String pNumeromensaje){
  numeromensaje=pNumeromensaje;
}

public static final String STRANSACCION="STRANSACCION";
/**Obtiene el valor de stransaccion
@return valor de stransaccion*/
public Integer getStransaccion(){
  return stransaccion;
}
/**Fija el valor de stransaccion
@param pStransaccion nuevo Valor de stransaccion*/
public void setStransaccion(Integer pStransaccion){
  stransaccion=pStransaccion;
}

public static final String PARTICION="PARTICION";
/**Obtiene el valor de particion
@return valor de particion*/
public String getParticion(){
  return particion;
}
/**Fija el valor de particion
@param pParticion nuevo Valor de particion*/
public void setParticion(String pParticion){
  particion=pParticion;
}

public static final String PK_NUMEROMENSAJE="NUMEROMENSAJE";
public static final String PK_STRANSACCION="STRANSACCION";
public static final String PK_PARTICION="PARTICION";
/**Implementaci�n de la comparaci�n de TmovementKey
@param o Objeto de comparaciï¿½n
*/
public boolean equals(Object o){
  if (o == null){return false;}
  if (! (o instanceof TmovementKey)){return false;}
  TmovementKey that = (TmovementKey) o;
  if (this.getNumeromensaje() == null || that.getNumeromensaje() == null){
      return false;
  }
  if (! this.getNumeromensaje().equals(that.getNumeromensaje())){
    return false;
  }
  if (this.getStransaccion() == null || that.getStransaccion() == null){
      return false;
  }
  if (! this.getStransaccion().equals(that.getStransaccion())){
    return false;
  }
  if (this.getParticion() == null || that.getParticion() == null){
      return false;
  }
  if (! this.getParticion().equals(that.getParticion())){
    return false;
  }
  return true;
}
/**Implementaci�n del m�todo hashCode bajo el patr�n de Bloch
@return hashCode de la instancia TmovementKey
*/
public int hashCode(){
  if (this.hashValue == 0){
    int result = 17;
    result = result * 37 + (this.getNumeromensaje() == null ? 0 : this.getNumeromensaje().hashCode());
    result = result * 37 + (this.getStransaccion() == null ? 0 : this.getStransaccion().hashCode());
    result = result * 37 + (this.getParticion() == null ? 0 : this.getParticion().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;
	}
}
