package com.fp.persistence.pgeneral.acco;

import javax.persistence.Column;
import java.io.Serializable;
import com.fp.dto.hb.HibernateId;
import java.lang.reflect.Field;
import javax.persistence.Embeddable;
import javax.persistence.Transient;

/**Clase que hace referencia a la Clave Primaria de TGENEACCOUNTLIQUIDATION*/
@Embeddable
public class TgeneAccountLiquidationKey  extends com.fp.dto.AbstractDataTransport  implements Serializable,Cloneable,HibernateId{
/**
* HashCode asociado con la Instancia
*/
@Transient
private int hashValue = 0;
/**
* Version de la Clase
*/
private static final long serialVersionUID = 1L;
@Column(name="ACCOUNT", nullable=false,updatable=false)

/**
* Numero de cuenta
*/
private String account;

@Column(name="COMPANY", nullable=false,updatable=false)

/**
* Codigo de compania a la que pertence la cuenta
*/
private Integer company;

@Column(name="MODULECODE", nullable=false,updatable=false)

/**
* Codigo de modulo
*/
private String modulecode;

@Column(name="PRODUCTCODE", nullable=false,updatable=false)

/**
* Codigo de producto
*/
private String productcode;

@Column(name="SUBPRODUCTCODE", nullable=false,updatable=false)

/**
* Codigo de subproducto
*/
private String subproductcode;

@Column(name="STATUSCODE", nullable=false,updatable=false)

/**
* Estatus de cuenta
*/
private String statuscode;

@Column(name="CURRENCYCODE", nullable=false,updatable=false)

/**
* Codigo de moneda
*/
private String currencycode;

@Column(name="BALANCETYPE", nullable=false,updatable=false)

/**
* Código de tipo de saldo. de valores a cobrar en la liquidacion de una operacion
*/
private String balancetype;

@Column(name="BALANCEGROUP", nullable=false,updatable=false)

/**
* Codigo del grupo de balance 1 Activo, 2 Pasivo, 3 Patrimonio .. 62 contingente deudor 61 por contra deudor 
*/
private String balancegroup;

/**Contructor por defecto*/
public TgeneAccountLiquidationKey(){}
/**Contructor de TgeneAccountLiquidationKey
@param pAccount Numero de cuenta
@param pCompany Codigo de compania a la que pertence la cuenta
@param pModulecode Codigo de modulo
@param pProductcode Codigo de producto
@param pSubproductcode Codigo de subproducto
@param pStatuscode Estatus de cuenta
@param pCurrencycode Codigo de moneda
@param pBalancetype Código de tipo de saldo. de valores a cobrar en la liquidacion de una operacion
@param pBalancegroup Codigo del grupo de balance 1 Activo, 2 Pasivo, 3 Patrimonio .. 62 contingente deudor 61 por contra deudor 
*/
public TgeneAccountLiquidationKey(String pAccount,Integer pCompany,String pModulecode,String pProductcode,String pSubproductcode,String pStatuscode,String pCurrencycode,String pBalancetype,String pBalancegroup){
 account=pAccount;
 company=pCompany;
 modulecode=pModulecode;
 productcode=pProductcode;
 subproductcode=pSubproductcode;
 statuscode=pStatuscode;
 currencycode=pCurrencycode;
 balancetype=pBalancetype;
 balancegroup=pBalancegroup;
}
/**Obtiene el valor de account
@return valor de account*/
public String getAccount(){
  return account;
}
/**Fija el valor de account
@param pAccount nuevo Valor de account*/
public void setAccount(String pAccount){
  account=pAccount;
}

/**Obtiene el valor de company
@return valor de company*/
public Integer getCompany(){
  return company;
}
/**Fija el valor de company
@param pCompany nuevo Valor de company*/
public void setCompany(Integer pCompany){
  company=pCompany;
}

/**Obtiene el valor de modulecode
@return valor de modulecode*/
public String getModulecode(){
  return modulecode;
}
/**Fija el valor de modulecode
@param pModulecode nuevo Valor de modulecode*/
public void setModulecode(String pModulecode){
  modulecode=pModulecode;
}

/**Obtiene el valor de productcode
@return valor de productcode*/
public String getProductcode(){
  return productcode;
}
/**Fija el valor de productcode
@param pProductcode nuevo Valor de productcode*/
public void setProductcode(String pProductcode){
  productcode=pProductcode;
}

/**Obtiene el valor de subproductcode
@return valor de subproductcode*/
public String getSubproductcode(){
  return subproductcode;
}
/**Fija el valor de subproductcode
@param pSubproductcode nuevo Valor de subproductcode*/
public void setSubproductcode(String pSubproductcode){
  subproductcode=pSubproductcode;
}

/**Obtiene el valor de statuscode
@return valor de statuscode*/
public String getStatuscode(){
  return statuscode;
}
/**Fija el valor de statuscode
@param pStatuscode nuevo Valor de statuscode*/
public void setStatuscode(String pStatuscode){
  statuscode=pStatuscode;
}

/**Obtiene el valor de currencycode
@return valor de currencycode*/
public String getCurrencycode(){
  return currencycode;
}
/**Fija el valor de currencycode
@param pCurrencycode nuevo Valor de currencycode*/
public void setCurrencycode(String pCurrencycode){
  currencycode=pCurrencycode;
}

/**Obtiene el valor de balancetype
@return valor de balancetype*/
public String getBalancetype(){
  return balancetype;
}
/**Fija el valor de balancetype
@param pBalancetype nuevo Valor de balancetype*/
public void setBalancetype(String pBalancetype){
  balancetype=pBalancetype;
}

/**Obtiene el valor de balancegroup
@return valor de balancegroup*/
public String getBalancegroup(){
  return balancegroup;
}
/**Fija el valor de balancegroup
@param pBalancegroup nuevo Valor de balancegroup*/
public void setBalancegroup(String pBalancegroup){
  balancegroup=pBalancegroup;
}

/**Implementación de la comparación de TgeneAccountLiquidationKey
@param o Objeto de comparación
*/
public boolean equals(Object o){
  if (o == null)return false;
  if (! (o instanceof TgeneAccountLiquidationKey))return false;
  TgeneAccountLiquidationKey that = (TgeneAccountLiquidationKey) o;
  if (this.getAccount() == null || that.getAccount() == null){
      return false;
  }
  if (! this.getAccount().equals(that.getAccount())){
    return false;
  }
  if (this.getCompany() == null || that.getCompany() == null){
      return false;
  }
  if (! this.getCompany().equals(that.getCompany())){
    return false;
  }
  if (this.getModulecode() == null || that.getModulecode() == null){
      return false;
  }
  if (! this.getModulecode().equals(that.getModulecode())){
    return false;
  }
  if (this.getProductcode() == null || that.getProductcode() == null){
      return false;
  }
  if (! this.getProductcode().equals(that.getProductcode())){
    return false;
  }
  if (this.getSubproductcode() == null || that.getSubproductcode() == null){
      return false;
  }
  if (! this.getSubproductcode().equals(that.getSubproductcode())){
    return false;
  }
  if (this.getStatuscode() == null || that.getStatuscode() == null){
      return false;
  }
  if (! this.getStatuscode().equals(that.getStatuscode())){
    return false;
  }
  if (this.getCurrencycode() == null || that.getCurrencycode() == null){
      return false;
  }
  if (! this.getCurrencycode().equals(that.getCurrencycode())){
    return false;
  }
  if (this.getBalancetype() == null || that.getBalancetype() == null){
      return false;
  }
  if (! this.getBalancetype().equals(that.getBalancetype())){
    return false;
  }
  if (this.getBalancegroup() == null || that.getBalancegroup() == null){
      return false;
  }
  if (! this.getBalancegroup().equals(that.getBalancegroup())){
    return false;
  }
  return true;
}
/**Implementación del método hashCode bajo el patrón de Bloch
@return hashCode de la instancia TgeneAccountLiquidationKey
*/
public int hashCode(){
  if (this.hashValue == 0){
    int result = 17;
    result = result * 37 + (this.getAccount() == null ? 0 : this.getAccount().hashCode());
    result = result * 37 + (this.getCompany() == null ? 0 : this.getCompany().hashCode());
    result = result * 37 + (this.getModulecode() == null ? 0 : this.getModulecode().hashCode());
    result = result * 37 + (this.getProductcode() == null ? 0 : this.getProductcode().hashCode());
    result = result * 37 + (this.getSubproductcode() == null ? 0 : this.getSubproductcode().hashCode());
    result = result * 37 + (this.getStatuscode() == null ? 0 : this.getStatuscode().hashCode());
    result = result * 37 + (this.getCurrencycode() == null ? 0 : this.getCurrencycode().hashCode());
    result = result * 37 + (this.getBalancetype() == null ? 0 : this.getBalancetype().hashCode());
    result = result * 37 + (this.getBalancegroup() == null ? 0 : this.getBalancegroup().hashCode());
    this.hashValue = result;
  }
  return this.hashValue;
}
public Object cloneMe() throws CloneNotSupportedException {
  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(f.getType().getName().compareTo("java.util.Set")==0)continue;
	 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;
	}
}
