233 lines
6.7 KiB
Plaintext
Executable File
233 lines
6.7 KiB
Plaintext
Executable File
package com.fp.persistence.pgeneral.prov;
|
|
|
|
import javax.persistence.EmbeddedId;
|
|
import javax.persistence.Entity;
|
|
import javax.persistence.Column;
|
|
import javax.persistence.EntityManager;
|
|
import java.io.Serializable;
|
|
import java.math.BigDecimal;
|
|
import javax.persistence.Table;
|
|
|
|
import com.fp.dto.hb.Cache;
|
|
import com.fp.dto.hb.HibernateBean;
|
|
import java.lang.reflect.Field;
|
|
import javax.persistence.Transient;
|
|
|
|
/**Clase que implementa la entidad de Hibernate que hace referencia a la tabla TGENEDEFAULTPROVISION*/
|
|
@Entity(name="TgeneDefaultProvision")
|
|
@Table(name="TGENEDEFAULTPROVISION")
|
|
public class TgeneDefaultProvision extends com.fp.dto.AbstractDataTransport implements Serializable,HibernateBean,Cloneable,Cache{
|
|
/**
|
|
* HashCode asociado con la Instancia
|
|
*/
|
|
@Transient
|
|
private int hashValue = 0;
|
|
/**
|
|
* Version de la Clase
|
|
*/
|
|
private static final long serialVersionUID = 1L;
|
|
/**
|
|
* Clave primaria de la Entidad TgeneDefaultProvision
|
|
*/
|
|
@EmbeddedId
|
|
private TgeneDefaultProvisionKey pk;
|
|
@Column(name="INTERESTBALANCETYPE", nullable=true)
|
|
|
|
/**
|
|
* Código de tipo de saldo. Del interes normal, sirve para obtener la tasa anterior.
|
|
*/
|
|
private String interestbalancetype;
|
|
|
|
@Column(name="INTERESTBALANCEGROUP", nullable=true)
|
|
|
|
/**
|
|
* Codigo del grupo de balance 1 Activo, 2 Pasivo, 3 Patrimonio .. 62 contingente deudor 61 por contra deudor
|
|
*/
|
|
private String interestbalancegroup;
|
|
|
|
@Column(name="GRACEDAYS", nullable=true)
|
|
|
|
/**
|
|
* Y, Indica que se considera dias de gracia para el calculo de la provision, N no considera dias de gracia y calcula desde el vencimiento de la cuota
|
|
*/
|
|
private String gracedays;
|
|
|
|
@Column(name="OPERATOR", nullable=true)
|
|
|
|
/**
|
|
* Operador a aplicar sobre la tasa base, +, - , %
|
|
*/
|
|
private String operator;
|
|
|
|
@Column(name="MARGIN", nullable=true)
|
|
|
|
/**
|
|
* Margen a aplicar sobre la tasa real del tipo de saldo de interes.
|
|
*/
|
|
private BigDecimal margin;
|
|
|
|
@Column(name="RATEFROMTARIF", nullable=true)
|
|
|
|
/**
|
|
* Y indica que la tasa se obtiene del tarifario
|
|
*/
|
|
private String ratefromtarif;
|
|
|
|
/**Contructor por defecto*/
|
|
public TgeneDefaultProvision(){
|
|
}
|
|
/**Contructor de TgeneDefaultProvision
|
|
@param pPk Clave Primaria del entity
|
|
*/
|
|
public TgeneDefaultProvision(TgeneDefaultProvisionKey pPk){
|
|
this();
|
|
pk=pPk;
|
|
}
|
|
/**
|
|
* Metodo que entrega datos de la tabla dada la clave primaria.
|
|
* @param pEntityManager referencia de la session a obtener datos del bean.
|
|
* @param pKey Caleve primaria del bean.
|
|
* @return TgeneDefaultProvision
|
|
*/
|
|
public static TgeneDefaultProvision find(EntityManager pEntityManager,TgeneDefaultProvisionKey pKey) throws Exception{
|
|
TgeneDefaultProvision obj = pEntityManager.find(TgeneDefaultProvision.class,pKey);
|
|
return obj;
|
|
}
|
|
/**Entrega la Clave primaria de TgeneDefaultProvision
|
|
@return El objeto que referencia a la Clave primaria de TgeneDefaultProvision
|
|
*/
|
|
public TgeneDefaultProvisionKey getPk(){
|
|
return pk;
|
|
}
|
|
/**Fija un nuevo valor a la Clave primaria de TgeneDefaultProvision
|
|
@param pPk El objeto que referencia a la nueva Clave primaria de TgeneDefaultProvision
|
|
*/
|
|
public void setPk(TgeneDefaultProvisionKey pPk){
|
|
pk=pPk;
|
|
}
|
|
/**Obtiene el valor de interestbalancetype
|
|
@return valor de interestbalancetype*/
|
|
public String getInterestbalancetype(){
|
|
return interestbalancetype;
|
|
}
|
|
/**Fija el valor de interestbalancetype
|
|
@param pInterestbalancetype nuevo Valor de interestbalancetype*/
|
|
public void setInterestbalancetype(String pInterestbalancetype){
|
|
interestbalancetype=pInterestbalancetype;
|
|
}
|
|
|
|
/**Obtiene el valor de interestbalancegroup
|
|
@return valor de interestbalancegroup*/
|
|
public String getInterestbalancegroup(){
|
|
return interestbalancegroup;
|
|
}
|
|
/**Fija el valor de interestbalancegroup
|
|
@param pInterestbalancegroup nuevo Valor de interestbalancegroup*/
|
|
public void setInterestbalancegroup(String pInterestbalancegroup){
|
|
interestbalancegroup=pInterestbalancegroup;
|
|
}
|
|
|
|
/**Obtiene el valor de gracedays
|
|
@return valor de gracedays*/
|
|
public String getGracedays(){
|
|
return gracedays;
|
|
}
|
|
/**Fija el valor de gracedays
|
|
@param pGracedays nuevo Valor de gracedays*/
|
|
public void setGracedays(String pGracedays){
|
|
gracedays=pGracedays;
|
|
}
|
|
|
|
/**Obtiene el valor de operator
|
|
@return valor de operator*/
|
|
public String getOperator(){
|
|
return operator;
|
|
}
|
|
/**Fija el valor de operator
|
|
@param pOperator nuevo Valor de operator*/
|
|
public void setOperator(String pOperator){
|
|
operator=pOperator;
|
|
}
|
|
|
|
/**Obtiene el valor de margin
|
|
@return valor de margin*/
|
|
public BigDecimal getMargin(){
|
|
return margin;
|
|
}
|
|
/**Fija el valor de margin
|
|
@param pMargin nuevo Valor de margin*/
|
|
public void setMargin(BigDecimal pMargin){
|
|
margin=pMargin;
|
|
}
|
|
|
|
/**Obtiene el valor de ratefromtarif
|
|
@return valor de ratefromtarif*/
|
|
public String getRatefromtarif(){
|
|
return ratefromtarif;
|
|
}
|
|
/**Fija el valor de ratefromtarif
|
|
@param pRatefromtarif nuevo Valor de ratefromtarif*/
|
|
public void setRatefromtarif(String pRatefromtarif){
|
|
ratefromtarif=pRatefromtarif;
|
|
}
|
|
|
|
public boolean equals(Object rhs){
|
|
if (rhs == null)return false;
|
|
if (! (rhs instanceof TgeneDefaultProvision))return false;
|
|
TgeneDefaultProvision that = (TgeneDefaultProvision) 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 TgeneDefaultProvision
|
|
@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(f.getType().getName().compareTo("java.util.Set")==0)continue;
|
|
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 blanco TgeneDefaultProvision
|
|
*/
|
|
public Object createInstance(){
|
|
TgeneDefaultProvision instance=new TgeneDefaultProvision();
|
|
instance.setPk(new TgeneDefaultProvisionKey());
|
|
return instance;
|
|
}
|
|
/**Clona la entidad TgeneDefaultProvision
|
|
@see com.fp.dto.hb.HibernateBean#cloneMe()
|
|
*/
|
|
public Object cloneMe() throws CloneNotSupportedException{
|
|
TgeneDefaultProvision p=(TgeneDefaultProvision)this.clone();
|
|
p.setPk((TgeneDefaultProvisionKey)this.pk.cloneMe());
|
|
return p;
|
|
}
|
|
}
|