package com.fitbank.hb.persistence.service;

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

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

/**
* Codigo del subsistema asociado al servicio
*/
private String csubsistema_servicio;

/**
* Codigo del servicio de homebanking
*/
private Integer cservicio;

/**
* Fecha hasta la que estan vigentes los datos del servicio de la persona
*/
private Timestamp fhasta;

/**Contructor por defecto*/
public TservicepersonhomebankingKey(){}
/**Contructor de TservicepersonhomebankingKey
@param pCpersona Codigo de persona asociada a la cuenta
@param pCpersona_compania Codigo de persona de la compania del servicio
@param pCsubsistema_servicio Codigo del subsistema asociado al servicio
@param pCservicio Codigo del servicio de homebanking
@param pFhasta Fecha hasta la que estan vigentes los datos del servicio de la persona
*/
public TservicepersonhomebankingKey(Integer pCpersona,Integer pCpersona_compania,String pCsubsistema_servicio,Integer pCservicio,Timestamp pFhasta){
 cpersona=pCpersona;
 cpersona_compania=pCpersona_compania;
 csubsistema_servicio=pCsubsistema_servicio;
 cservicio=pCservicio;
 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 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 CSUBSISTEMA_SERVICIO="CSUBSISTEMA_SERVICIO";
/**Obtiene el valor de csubsistema_servicio
@return valor de csubsistema_servicio*/
public String getCsubsistema_servicio(){
  return csubsistema_servicio;
}
/**Fija el valor de csubsistema_servicio
@param pCsubsistema_servicio nuevo Valor de csubsistema_servicio*/
public void setCsubsistema_servicio(String pCsubsistema_servicio){
  csubsistema_servicio=pCsubsistema_servicio;
}

public static final String CSERVICIO="CSERVICIO";
/**Obtiene el valor de cservicio
@return valor de cservicio*/
public Integer getCservicio(){
  return cservicio;
}
/**Fija el valor de cservicio
@param pCservicio nuevo Valor de cservicio*/
public void setCservicio(Integer pCservicio){
  cservicio=pCservicio;
}

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_CPERSONA_COMPANIA="CPERSONA_COMPANIA";
public static final String PK_CSUBSISTEMA_SERVICIO="CSUBSISTEMA_SERVICIO";
public static final String PK_CSERVICIO="CSERVICIO";
public static final String PK_FHASTA="FHASTA";
/**Implementaciï¿½n de la comparaciï¿½n de TservicepersonhomebankingKey
@param o Objeto de comparaciÃ¯Â¿Â½n
*/
public boolean equals(Object o){
  if (o == null){return false;}
  if (! (o instanceof TservicepersonhomebankingKey)){return false;}
  TservicepersonhomebankingKey that = (TservicepersonhomebankingKey) o;
  if (this.getCpersona() == null || that.getCpersona() == null){
      return false;
  }
  if (! this.getCpersona().equals(that.getCpersona())){
    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.getCsubsistema_servicio() == null || that.getCsubsistema_servicio() == null){
      return false;
  }
  if (! this.getCsubsistema_servicio().equals(that.getCsubsistema_servicio())){
    return false;
  }
  if (this.getCservicio() == null || that.getCservicio() == null){
      return false;
  }
  if (! this.getCservicio().equals(that.getCservicio())){
    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 TservicepersonhomebankingKey
*/
public int hashCode(){
  if (this.hashValue == 0){
    int result = 17;
    result = result * 37 + (this.getCpersona() == null ? 0 : this.getCpersona().hashCode());
    result = result * 37 + (this.getCpersona_compania() == null ? 0 : this.getCpersona_compania().hashCode());
    result = result * 37 + (this.getCsubsistema_servicio() == null ? 0 : this.getCsubsistema_servicio().hashCode());
    result = result * 37 + (this.getCservicio() == null ? 0 : this.getCservicio().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;
}
}
