package com.fitbank.hb.persistence.uci;

import java.io.Serializable;
import java.lang.reflect.Field;
import com.fitbank.common.TransportBean;

/**Clase que implementa la entidad de Hibernate que hace referencia a la tabla TMAPEOSUCURSALESCANAL*/
public class Tchannelbranchmapper implements Serializable,TransportBean,Cloneable{
/**
* HashCode asociado con la Instancia
*/
private volatile int hashValue = 0;
/**
* Version de la Clase
*/
private static final long serialVersionUID = 1L;
/**
* Clave primaria de la Entidad Tchannelbranchmapper
*/
private TchannelbranchmapperKey pk;
/**
* Codigo de oficina
*/
private Integer coficina;

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

/**Contructor por defecto*/
public Tchannelbranchmapper(){}
/**Contructor de Tchannelbranchmapper
@param pPk Clave Primaria del entity
@param pCoficina Codigo de oficina
@param pCsucursal Codigo de la sucursal
*/
public Tchannelbranchmapper(TchannelbranchmapperKey pPk,Integer pCoficina,Integer pCsucursal){
 pk=pPk;
 coficina=pCoficina;
 csucursal=pCsucursal;
}
/**Entrega la Clave primaria de Tchannelbranchmapper
@return El objeto que referencia a la Clave primaria de Tchannelbranchmapper
*/
public TchannelbranchmapperKey getPk(){
  return pk;
}
/**Fija un nuevo valor a la Clave primaria de Tchannelbranchmapper
@param pPk El objeto que referencia a la nueva Clave primaria de Tchannelbranchmapper
*/
public void setPk(TchannelbranchmapperKey pPk){
  pk=pPk;
}
/**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;
}

/**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;
}

/**Implementación de la comparación de la entidad Tchannelbranchmapper
@param rhs Elemento de Comparación
@return el resultado de la comparación
*/
public boolean equals(Object rhs){
    if (rhs == null)return false;
    if (! (rhs instanceof Tchannelbranchmapper))return false;
    Tchannelbranchmapper that = (Tchannelbranchmapper) rhs;
    if (this.getPk() == null || that.getPk() == null)
        return false;
    return (this.getPk().equals(that.getPk()));
}
/**Implementación del metodo hashCode de la la entidad Tchannelbranchmapper
@return el hashCode la instancia
*/
public int hashCode()    {
    if (this.hashValue == 0){
        int result = 17;
        if (this.getPk() == null){
            result = super.hashCode();
        }else{
            result = this.getPk().hashCode();
        }
        this.hashValue = result;
    }
    return this.hashValue;
}
/**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+=name+"="+f.get(this)+";";
	 }catch(Exception e){
		 continue;
	 }
		}
		if(data.compareTo("")==0){
		data=super.toString();
		}
	return data;
	}
/**Implementación de la creación de un bean en blancoTchannelbranchmapper
*/
public Object createInstance() throws Exception{
 Tchannelbranchmapper instance=new Tchannelbranchmapper();	
 instance.setPk(new TchannelbranchmapperKey());
 return instance;
}
public Object cloneMe() throws Exception{
  Tchannelbranchmapper p=(Tchannelbranchmapper)this.clone();
  p.setPk((TchannelbranchmapperKey)this.pk.cloneMe());
  return p;
}
}
