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

/**
* Codigo del departamento como: 1= Credito, 2 = Ventanillas
*/
private Integer cdepartamento;

/**
* Codigo de oficina
*/
private Integer coficina;

/**
* Codigo de la sucursal
*/
private Integer csucursal;

/**
* Fecha hasta la que esta vigente la autorizacion
*/
private Timestamp fhasta;

/**Contructor por defecto*/
public TbranchdepartmentcontactKey(){}
/**Contructor de TbranchdepartmentcontactKey
@param pCpersona_compania Codigo de la compania
@param pCdepartamento Codigo del departamento como: 1= Credito, 2 = Ventanillas
@param pCoficina Codigo de oficina
@param pCsucursal Codigo de la sucursal
@param pFhasta Fecha hasta la que esta vigente la autorizacion
*/
public TbranchdepartmentcontactKey(Integer pCpersona_compania,Integer pCdepartamento,Integer pCoficina,Integer pCsucursal,Timestamp pFhasta){
 cpersona_compania=pCpersona_compania;
 cdepartamento=pCdepartamento;
 coficina=pCoficina;
 csucursal=pCsucursal;
 fhasta=pFhasta;
}
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 CDEPARTAMENTO="CDEPARTAMENTO";
/**Obtiene el valor de cdepartamento
@return valor de cdepartamento*/
public Integer getCdepartamento(){
  return cdepartamento;
}
/**Fija el valor de cdepartamento
@param pCdepartamento nuevo Valor de cdepartamento*/
public void setCdepartamento(Integer pCdepartamento){
  cdepartamento=pCdepartamento;
}

public static final String COFICINA="COFICINA";
/**Obtiene el valor de coficina
@return valor de coficina*/
public Integer getCoficina(){
  return coficina;
}
/**Fija el valor de coficina
@param pCoficina nuevo Valor de coficina*/
public void setCoficina(Integer pCoficina){
  coficina=pCoficina;
}

public static final String CSUCURSAL="CSUCURSAL";
/**Obtiene el valor de csucursal
@return valor de csucursal*/
public Integer getCsucursal(){
  return csucursal;
}
/**Fija el valor de csucursal
@param pCsucursal nuevo Valor de csucursal*/
public void setCsucursal(Integer pCsucursal){
  csucursal=pCsucursal;
}

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_COMPANIA="CPERSONA_COMPANIA";
public static final String PK_CDEPARTAMENTO="CDEPARTAMENTO";
public static final String PK_COFICINA="COFICINA";
public static final String PK_CSUCURSAL="CSUCURSAL";
public static final String PK_FHASTA="FHASTA";
/**Implementaci�n de la comparaci�n de TbranchdepartmentcontactKey
@param o Objeto de comparaciï¿½n
*/
public boolean equals(Object o){
  if (o == null){return false;}
  if (! (o instanceof TbranchdepartmentcontactKey)){return false;}
  TbranchdepartmentcontactKey that = (TbranchdepartmentcontactKey) o;
  if (this.getCpersona_compania() == null || that.getCpersona_compania() == null){
      return false;
  }
  if (! this.getCpersona_compania().equals(that.getCpersona_compania())){
    return false;
  }
  if (this.getCdepartamento() == null || that.getCdepartamento() == null){
      return false;
  }
  if (! this.getCdepartamento().equals(that.getCdepartamento())){
    return false;
  }
  if (this.getCoficina() == null || that.getCoficina() == null){
      return false;
  }
  if (! this.getCoficina().equals(that.getCoficina())){
    return false;
  }
  if (this.getCsucursal() == null || that.getCsucursal() == null){
      return false;
  }
  if (! this.getCsucursal().equals(that.getCsucursal())){
    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 TbranchdepartmentcontactKey
*/
public int hashCode(){
  if (this.hashValue == 0){
    int result = 17;
    result = result * 37 + (this.getCpersona_compania() == null ? 0 : this.getCpersona_compania().hashCode());
    result = result * 37 + (this.getCdepartamento() == null ? 0 : this.getCdepartamento().hashCode());
    result = result * 37 + (this.getCoficina() == null ? 0 : this.getCoficina().hashCode());
    result = result * 37 + (this.getCsucursal() == null ? 0 : this.getCsucursal().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;
}
}
