package com.fp.persistence.pgeneral.charge; import javax.persistence.Column; import java.io.Serializable; import java.math.BigDecimal; 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 TGENECHARGESGROUP*/ @Embeddable public class TgeneChargesGroupKey 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="CHARGECATALOG", nullable=false,updatable=false) /** * Codigo de catalogo EMPLOYEE, VIP etc */ private String chargecatalog; @Column(name="CHARGECATALOGCODE", nullable=false,updatable=false) /** * Codigo de tabla de catalogo (CHARGES) */ private String chargecatalogcode; @Column(name="BALANCETYPE", nullable=false,updatable=false) /** * Código de tipo de saldo. Efectivo, Bloqueado , Pignorado, Retenciones Locales, remesas ..Etc */ 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; @Column(name="MODULECODE", nullable=false,updatable=false) /** * Codigo de modulo */ private String modulecode; @Column(name="STATUSCODE", nullable=false,updatable=false) /** * Estatus de cuenta */ private String statuscode; @Column(name="COMPANYCODE", nullable=false,updatable=false) /** * Codigo de compania */ private Integer companycode; @Column(name="CURRENCYCODE", nullable=false,updatable=false) /** * Codigo de moneda de la cuenta */ private String currencycode; @Column(name="MINAMOUNT", nullable=false,updatable=false) /** * Monto minimo para buscar el cargo */ private BigDecimal minamount; /**Contructor por defecto*/ public TgeneChargesGroupKey(){} /**Contructor de TgeneChargesGroupKey @param pChargecatalog Codigo de catalogo EMPLOYEE, VIP etc @param pChargecatalogcode Codigo de tabla de catalogo (CHARGES) @param pBalancetype Código de tipo de saldo. Efectivo, Bloqueado , Pignorado, Retenciones Locales, remesas ..Etc @param pBalancegroup Codigo del grupo de balance 1 Activo, 2 Pasivo, 3 Patrimonio .. 62 contingente deudor 61 por contra deudor @param pModulecode Codigo de modulo @param pStatuscode Estatus de cuenta @param pCompanycode Codigo de compania @param pCurrencycode Codigo de moneda de la cuenta @param pMinamount Monto minimo para buscar el cargo */ public TgeneChargesGroupKey(String pChargecatalog,String pChargecatalogcode,String pBalancetype,String pBalancegroup,String pModulecode,String pStatuscode,Integer pCompanycode,String pCurrencycode,BigDecimal pMinamount){ chargecatalog=pChargecatalog; chargecatalogcode=pChargecatalogcode; balancetype=pBalancetype; balancegroup=pBalancegroup; modulecode=pModulecode; statuscode=pStatuscode; companycode=pCompanycode; currencycode=pCurrencycode; minamount=pMinamount; } /**Obtiene el valor de chargecatalog @return valor de chargecatalog*/ public String getChargecatalog(){ return chargecatalog; } /**Fija el valor de chargecatalog @param pChargecatalog nuevo Valor de chargecatalog*/ public void setChargecatalog(String pChargecatalog){ chargecatalog=pChargecatalog; } /**Obtiene el valor de chargecatalogcode @return valor de chargecatalogcode*/ public String getChargecatalogcode(){ return chargecatalogcode; } /**Fija el valor de chargecatalogcode @param pChargecatalogcode nuevo Valor de chargecatalogcode*/ public void setChargecatalogcode(String pChargecatalogcode){ chargecatalogcode=pChargecatalogcode; } /**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; } /**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 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 companycode @return valor de companycode*/ public Integer getCompanycode(){ return companycode; } /**Fija el valor de companycode @param pCompanycode nuevo Valor de companycode*/ public void setCompanycode(Integer pCompanycode){ companycode=pCompanycode; } /**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 minamount @return valor de minamount*/ public BigDecimal getMinamount(){ return minamount; } /**Fija el valor de minamount @param pMinamount nuevo Valor de minamount*/ public void setMinamount(BigDecimal pMinamount){ minamount=pMinamount; } /**Implementación de la comparación de TgeneChargesGroupKey @param o Objeto de comparación */ public boolean equals(Object o){ if (o == null)return false; if (! (o instanceof TgeneChargesGroupKey))return false; TgeneChargesGroupKey that = (TgeneChargesGroupKey) o; if (this.getChargecatalog() == null || that.getChargecatalog() == null){ return false; } if (! this.getChargecatalog().equals(that.getChargecatalog())){ return false; } if (this.getChargecatalogcode() == null || that.getChargecatalogcode() == null){ return false; } if (! this.getChargecatalogcode().equals(that.getChargecatalogcode())){ 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; } if (this.getModulecode() == null || that.getModulecode() == null){ return false; } if (! this.getModulecode().equals(that.getModulecode())){ return false; } if (this.getStatuscode() == null || that.getStatuscode() == null){ return false; } if (! this.getStatuscode().equals(that.getStatuscode())){ return false; } if (this.getCompanycode() == null || that.getCompanycode() == null){ return false; } if (! this.getCompanycode().equals(that.getCompanycode())){ return false; } if (this.getCurrencycode() == null || that.getCurrencycode() == null){ return false; } if (! this.getCurrencycode().equals(that.getCurrencycode())){ return false; } if (this.getMinamount() == null || that.getMinamount() == null){ return false; } if (! this.getMinamount().equals(that.getMinamount())){ return false; } return true; } /**Implementación del método hashCode bajo el patrón de Bloch @return hashCode de la instancia TgeneChargesGroupKey */ public int hashCode(){ if (this.hashValue == 0){ int result = 17; result = result * 37 + (this.getChargecatalog() == null ? 0 : this.getChargecatalog().hashCode()); result = result * 37 + (this.getChargecatalogcode() == null ? 0 : this.getChargecatalogcode().hashCode()); result = result * 37 + (this.getBalancetype() == null ? 0 : this.getBalancetype().hashCode()); result = result * 37 + (this.getBalancegroup() == null ? 0 : this.getBalancegroup().hashCode()); result = result * 37 + (this.getModulecode() == null ? 0 : this.getModulecode().hashCode()); result = result * 37 + (this.getStatuscode() == null ? 0 : this.getStatuscode().hashCode()); result = result * 37 + (this.getCompanycode() == null ? 0 : this.getCompanycode().hashCode()); result = result * 37 + (this.getCurrencycode() == null ? 0 : this.getCurrencycode().hashCode()); result = result * 37 + (this.getMinamount() == null ? 0 : this.getMinamount().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; } }