125 lines
3.8 KiB
Plaintext
Executable File
125 lines
3.8 KiB
Plaintext
Executable File
package com.fp.persistence.pgeneral.transf;
|
|
|
|
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 TGENEMATURATION*/
|
|
@Embeddable
|
|
public class TgeneMaturationKey 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="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;
|
|
|
|
/**Contructor por defecto*/
|
|
public TgeneMaturationKey(){}
|
|
/**Contructor de TgeneMaturationKey
|
|
@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
|
|
*/
|
|
public TgeneMaturationKey(String pBalancetype,String pBalancegroup){
|
|
balancetype=pBalancetype;
|
|
balancegroup=pBalancegroup;
|
|
}
|
|
/**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 TgeneMaturationKey
|
|
@param o Objeto de comparación
|
|
*/
|
|
public boolean equals(Object o){
|
|
if (o == null)return false;
|
|
if (! (o instanceof TgeneMaturationKey))return false;
|
|
TgeneMaturationKey that = (TgeneMaturationKey) o;
|
|
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 TgeneMaturationKey
|
|
*/
|
|
public int hashCode(){
|
|
if (this.hashValue == 0){
|
|
int result = 17;
|
|
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;
|
|
}
|
|
}
|