package com.fitbank.hb.persistence.gene;

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 TJOYASMETALES*/
public class TjewerlymetalKey  extends AbstractExpire  implements Serializable,Cloneable,ManejaHistory{
/** Nombre de la Tabla TJOYASMETALES */
public static final String TABLE_NAME = "TJOYASMETALES";
/** HashCode asociado con la Instancia*/
private int hashValue = 0;
/** Version de la Clase*/
private static final long serialVersionUID = 1L;
/**
* Código de la joya de metal
*/
private Integer cjoyametal;

/**
* Código de la persona
*/
private Integer cpersona;

/**
* Secuencia del activo
*/
private Integer sactivo;

/**
* Secuencia del registro
*/
private Integer secuencia;

/**
* Fecha hasta
*/
private Timestamp fhasta;

/**Contructor por defecto*/
public TjewerlymetalKey(){}
/**Contructor de TjewerlymetalKey
@param pCjoyametal Código de la joya de metal
@param pCpersona Código de la persona
@param pSactivo Secuencia del activo
@param pSecuencia Secuencia del registro
@param pFhasta Fecha hasta
*/
public TjewerlymetalKey(Integer pCjoyametal,Integer pCpersona,Integer pSactivo,Integer pSecuencia,Timestamp pFhasta){
 cjoyametal=pCjoyametal;
 cpersona=pCpersona;
 sactivo=pSactivo;
 secuencia=pSecuencia;
 fhasta=pFhasta;
}
public static final String CJOYAMETAL="CJOYAMETAL";
/**Obtiene el valor de cjoyametal
@return valor de cjoyametal*/
public Integer getCjoyametal(){
  return cjoyametal;
}
/**Fija el valor de cjoyametal
@param pCjoyametal nuevo Valor de cjoyametal*/
public void setCjoyametal(Integer pCjoyametal){
  cjoyametal=pCjoyametal;
}

public static final String CPERSONA="CPERSONA";
/**Obtiene el valor de cpersona
@return valor de cpersona*/
public Integer getCpersona(){
  return cpersona;
}
/**Fija el valor de cpersona
@param pCpersona nuevo Valor de cpersona*/
public void setCpersona(Integer pCpersona){
  cpersona=pCpersona;
}

public static final String SACTIVO="SACTIVO";
/**Obtiene el valor de sactivo
@return valor de sactivo*/
public Integer getSactivo(){
  return sactivo;
}
/**Fija el valor de sactivo
@param pSactivo nuevo Valor de sactivo*/
public void setSactivo(Integer pSactivo){
  sactivo=pSactivo;
}

public static final String SECUENCIA="SECUENCIA";
/**Obtiene el valor de secuencia
@return valor de secuencia*/
public Integer getSecuencia(){
  return secuencia;
}
/**Fija el valor de secuencia
@param pSecuencia nuevo Valor de secuencia*/
public void setSecuencia(Integer pSecuencia){
  secuencia=pSecuencia;
}

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_CJOYAMETAL="CJOYAMETAL";
public static final String PK_CPERSONA="CPERSONA";
public static final String PK_SACTIVO="SACTIVO";
public static final String PK_SECUENCIA="SECUENCIA";
public static final String PK_FHASTA="FHASTA";
/**Implementaci�n de la comparaci�n de TjewerlymetalKey
@param o Objeto de comparaciï¿½n
*/
public boolean equals(Object o){
  if (o == null){return false;}
  if (! (o instanceof TjewerlymetalKey)){return false;}
  TjewerlymetalKey that = (TjewerlymetalKey) o;
  if (this.getCjoyametal() == null || that.getCjoyametal() == null){
      return false;
  }
  if (! this.getCjoyametal().equals(that.getCjoyametal())){
    return false;
  }
  if (this.getCpersona() == null || that.getCpersona() == null){
      return false;
  }
  if (! this.getCpersona().equals(that.getCpersona())){
    return false;
  }
  if (this.getSactivo() == null || that.getSactivo() == null){
      return false;
  }
  if (! this.getSactivo().equals(that.getSactivo())){
    return false;
  }
  if (this.getSecuencia() == null || that.getSecuencia() == null){
      return false;
  }
  if (! this.getSecuencia().equals(that.getSecuencia())){
    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 TjewerlymetalKey
*/
public int hashCode(){
  if (this.hashValue == 0){
    int result = 17;
    result = result * 37 + (this.getCjoyametal() == null ? 0 : this.getCjoyametal().hashCode());
    result = result * 37 + (this.getCpersona() == null ? 0 : this.getCpersona().hashCode());
    result = result * 37 + (this.getSactivo() == null ? 0 : this.getSactivo().hashCode());
    result = result * 37 + (this.getSecuencia() == null ? 0 : this.getSecuencia().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;
}
}
