package com.fitbank.hb.persistence.person;

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

/**
* Numero de direccion
*/
private Integer numerodireccion;

/**
* Numero consecutivo del detalle de la direccion de la persona
*/
private Integer sdirecciondetalle;

/**
* Fecha hasta la que estan vigentes los datos de direccion de una persona natural o juridica
*/
private Timestamp fhasta;

/**Contructor por defecto*/
public TaddresspersondetailKey(){}
/**Contructor de TaddresspersondetailKey
@param pCpersona Codigo de la persona
@param pNumerodireccion Numero de direccion
@param pSdirecciondetalle Numero consecutivo del detalle de la direccion de la persona
@param pFhasta Fecha hasta la que estan vigentes los datos de direccion de una persona natural o juridica
*/
public TaddresspersondetailKey(Integer pCpersona,Integer pNumerodireccion,Integer pSdirecciondetalle,Timestamp pFhasta){
 cpersona=pCpersona;
 numerodireccion=pNumerodireccion;
 sdirecciondetalle=pSdirecciondetalle;
 fhasta=pFhasta;
}
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 NUMERODIRECCION="NUMERODIRECCION";
/**Obtiene el valor de numerodireccion
@return valor de numerodireccion*/
public Integer getNumerodireccion(){
  return numerodireccion;
}
/**Fija el valor de numerodireccion
@param pNumerodireccion nuevo Valor de numerodireccion*/
public void setNumerodireccion(Integer pNumerodireccion){
  numerodireccion=pNumerodireccion;
}

public static final String SDIRECCIONDETALLE="SDIRECCIONDETALLE";
/**Obtiene el valor de sdirecciondetalle
@return valor de sdirecciondetalle*/
public Integer getSdirecciondetalle(){
  return sdirecciondetalle;
}
/**Fija el valor de sdirecciondetalle
@param pSdirecciondetalle nuevo Valor de sdirecciondetalle*/
public void setSdirecciondetalle(Integer pSdirecciondetalle){
  sdirecciondetalle=pSdirecciondetalle;
}

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="CPERSONA";
public static final String PK_NUMERODIRECCION="NUMERODIRECCION";
public static final String PK_SDIRECCIONDETALLE="SDIRECCIONDETALLE";
public static final String PK_FHASTA="FHASTA";
/**Implementaci?n de la comparaci?n de TaddresspersondetailKey
@param o Objeto de comparaci?n
*/
public boolean equals(Object o){
  if (o == null){return false;}
  if (! (o instanceof TaddresspersondetailKey)){return false;}
  TaddresspersondetailKey that = (TaddresspersondetailKey) o;
  if (this.getCpersona() == null || that.getCpersona() == null){
      return false;
  }
  if (! this.getCpersona().equals(that.getCpersona())){
    return false;
  }
  if (this.getNumerodireccion() == null || that.getNumerodireccion() == null){
      return false;
  }
  if (! this.getNumerodireccion().equals(that.getNumerodireccion())){
    return false;
  }
  if (this.getSdirecciondetalle() == null || that.getSdirecciondetalle() == null){
      return false;
  }
  if (! this.getSdirecciondetalle().equals(that.getSdirecciondetalle())){
    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 TaddresspersondetailKey
*/
public int hashCode(){
  if (this.hashValue == 0){
    int result = 17;
    result = result * 37 + (this.getCpersona() == null ? 0 : this.getCpersona().hashCode());
    result = result * 37 + (this.getNumerodireccion() == null ? 0 : this.getNumerodireccion().hashCode());
    result = result * 37 + (this.getSdirecciondetalle() == null ? 0 : this.getSdirecciondetalle().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;
}
}
