254 lines
8.4 KiB
Plaintext
Executable File
254 lines
8.4 KiB
Plaintext
Executable File
package com.fp.persistence.pgeneral.product.rate;
|
||
|
||
import java.io.Serializable;
|
||
import java.lang.reflect.Field;
|
||
import java.util.List;
|
||
|
||
import javax.persistence.Column;
|
||
import javax.persistence.EmbeddedId;
|
||
import javax.persistence.Entity;
|
||
import javax.persistence.EntityManager;
|
||
import javax.persistence.Query;
|
||
import javax.persistence.Table;
|
||
import javax.persistence.Transient;
|
||
|
||
import com.fp.dto.hb.HibernateBean;
|
||
|
||
/**Clase que implementa la entidad de Hibernate que hace referencia a la tabla TGENESUBPRODUCTINSTALLCHARGES*/
|
||
@Entity(name="TgeneSubProductInstallmentCharges")
|
||
@Table(name="TGENESUBPRODUCTINSTALLCHARGES")
|
||
public class TgeneSubProductInstallmentCharges extends com.fp.dto.AbstractDataTransport implements Serializable,HibernateBean,Cloneable{
|
||
/**
|
||
* 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 TgeneSubProductInstallmentCharges
|
||
*/
|
||
@EmbeddedId
|
||
private TgeneSubProductInstallmentChargesKey pk;
|
||
@Column(name="CALCULTATEORDER", nullable=true)
|
||
|
||
/**
|
||
* Orden de calculo de los cargos.
|
||
*/
|
||
private Integer calcultateorder;
|
||
|
||
@Column(name="BASEAMOUNTBALANCETYPE", nullable=true)
|
||
|
||
/**
|
||
* Tipo de saldo del cual se toma el monto para calcular el tarifario.
|
||
*/
|
||
private String baseamountbalancetype;
|
||
|
||
@Column(name="BASEAMOUNTBALANCEGROUP", nullable=true)
|
||
|
||
/**
|
||
* Grupo de balance asociado al tipo de saldo del cual se toma el monto para calcular el tarifario.
|
||
*/
|
||
private String baseamountbalancegroup;
|
||
|
||
@Column(name="NEGOTIABLE", nullable=true)
|
||
|
||
/**
|
||
* Indica si la tasa se puede negociar con el cliente el valor y las condiciones del cargo
|
||
*/
|
||
private String negotiable;
|
||
|
||
@Column(name="ACTIVE", nullable=true)
|
||
|
||
/**
|
||
* null
|
||
*/
|
||
private String active;
|
||
|
||
/**Contructor por defecto*/
|
||
public TgeneSubProductInstallmentCharges(){
|
||
}
|
||
/**Contructor de TgeneSubProductInstallmentCharges
|
||
@param pPk Clave Primaria del entity
|
||
*/
|
||
public TgeneSubProductInstallmentCharges(TgeneSubProductInstallmentChargesKey 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 TgeneSubProductInstallmentCharges
|
||
*/
|
||
public static TgeneSubProductInstallmentCharges find(EntityManager pEntityManager,TgeneSubProductInstallmentChargesKey pKey) throws Exception{
|
||
TgeneSubProductInstallmentCharges obj = pEntityManager.find(TgeneSubProductInstallmentCharges.class,pKey);
|
||
return obj;
|
||
}
|
||
/**Entrega la Clave primaria de TgeneSubProductInstallmentCharges
|
||
@return El objeto que referencia a la Clave primaria de TgeneSubProductInstallmentCharges
|
||
*/
|
||
public TgeneSubProductInstallmentChargesKey getPk(){
|
||
return pk;
|
||
}
|
||
/**Fija un nuevo valor a la Clave primaria de TgeneSubProductInstallmentCharges
|
||
@param pPk El objeto que referencia a la nueva Clave primaria de TgeneSubProductInstallmentCharges
|
||
*/
|
||
public void setPk(TgeneSubProductInstallmentChargesKey pPk){
|
||
pk=pPk;
|
||
}
|
||
/**Obtiene el valor de calcultateorder
|
||
@return valor de calcultateorder*/
|
||
public Integer getCalcultateorder(){
|
||
return calcultateorder;
|
||
}
|
||
/**Fija el valor de calcultateorder
|
||
@param pCalcultateorder nuevo Valor de calcultateorder*/
|
||
public void setCalcultateorder(Integer pCalcultateorder){
|
||
calcultateorder=pCalcultateorder;
|
||
}
|
||
|
||
/**Obtiene el valor de baseamountbalancetype
|
||
@return valor de baseamountbalancetype*/
|
||
public String getBaseamountbalancetype(){
|
||
return baseamountbalancetype;
|
||
}
|
||
/**Fija el valor de baseamountbalancetype
|
||
@param pBaseamountbalancetype nuevo Valor de baseamountbalancetype*/
|
||
public void setBaseamountbalancetype(String pBaseamountbalancetype){
|
||
baseamountbalancetype=pBaseamountbalancetype;
|
||
}
|
||
|
||
/**Obtiene el valor de baseamountbalancegroup
|
||
@return valor de baseamountbalancegroup*/
|
||
public String getBaseamountbalancegroup(){
|
||
return baseamountbalancegroup;
|
||
}
|
||
/**Fija el valor de baseamountbalancegroup
|
||
@param pBaseamountbalancegroup nuevo Valor de baseamountbalancegroup*/
|
||
public void setBaseamountbalancegroup(String pBaseamountbalancegroup){
|
||
baseamountbalancegroup=pBaseamountbalancegroup;
|
||
}
|
||
|
||
/**Obtiene el valor de negotiable
|
||
@return valor de negotiable*/
|
||
public String getNegotiable(){
|
||
return negotiable;
|
||
}
|
||
/**Fija el valor de negotiable
|
||
@param pNegotiable nuevo Valor de negotiable*/
|
||
public void setNegotiable(String pNegotiable){
|
||
negotiable=pNegotiable;
|
||
}
|
||
|
||
/**Obtiene el valor de active
|
||
@return valor de active*/
|
||
public String getActive(){
|
||
return active;
|
||
}
|
||
/**Fija el valor de active
|
||
@param pActive nuevo Valor de active*/
|
||
public void setActive(String pActive){
|
||
active=pActive;
|
||
}
|
||
|
||
public boolean equals(Object rhs){
|
||
if (rhs == null)return false;
|
||
if (! (rhs instanceof TgeneSubProductInstallmentCharges))return false;
|
||
TgeneSubProductInstallmentCharges that = (TgeneSubProductInstallmentCharges) rhs;
|
||
if (this.getPk() == null || that.getPk() == null)
|
||
return false;
|
||
return (this.getPk().equals(that.getPk()));
|
||
}
|
||
/**Implementaci<63>n del metodo hashCode de la la entidad TgeneSubProductInstallmentCharges
|
||
@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<63>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<63>n de la creaci<63>n de un bean en blanco TgeneSubProductInstallmentCharges
|
||
*/
|
||
public Object createInstance(){
|
||
TgeneSubProductInstallmentCharges instance=new TgeneSubProductInstallmentCharges();
|
||
instance.setPk(new TgeneSubProductInstallmentChargesKey());
|
||
return instance;
|
||
}
|
||
/**Clona la entidad TgeneSubProductInstallmentCharges
|
||
@see com.fp.dto.hb.HibernateBean#cloneMe()
|
||
*/
|
||
public Object cloneMe() throws CloneNotSupportedException{
|
||
TgeneSubProductInstallmentCharges p=(TgeneSubProductInstallmentCharges)this.clone();
|
||
p.setPk((TgeneSubProductInstallmentChargesKey)this.pk.cloneMe());
|
||
return p;
|
||
}
|
||
|
||
//Metodos manuales.
|
||
/**Sentencia que devuelve la definicion de cargos asociados al producto de una solicitud.*/
|
||
private static final String HQL_INSTALLMENT_CHARGES =
|
||
"from TgeneSubProductInstallmentCharges tinstcharg " +
|
||
" where tinstcharg.pk.modulecode = :modulecode "+
|
||
" and tinstcharg.pk.productcode = :productcode "+
|
||
" and tinstcharg.pk.subproductcode = :subproductcode "+
|
||
" and tinstcharg.pk.statuscode = :statuscode "+
|
||
" and tinstcharg.pk.currencycode = :currencycode "+
|
||
" and tinstcharg.active = 'Y' " ;
|
||
|
||
|
||
/**
|
||
* Entrega una lista de cargos asociados a una tabla de amortizacion.
|
||
* @param pModuleCode Codigo de modulo a obtener cargos asociados a la solicitud.
|
||
* @param pProductCode Codigo de producto a obtener cargos asociados a la solicitud.
|
||
* @param pSubproductCode Codigo de subproducto a obtener cargos asociados a la solicitud.
|
||
* @param pStatusCode Codigo de status a obtener cargos asociados a la solicitud.
|
||
* @param pCurrencyCode Codigo de moneda a obtener cargos asociados a la solicitud.
|
||
* @return List<TgeneSubProductInstallmentCharges>
|
||
* @throws Exception
|
||
*/
|
||
@SuppressWarnings("unchecked")
|
||
public static List<TgeneSubProductInstallmentCharges> find(EntityManager pEntityManager,
|
||
String pModuleCode,String pProductCode,
|
||
String pSubproductCode,String pStatusCode,String pCurrencyCode) throws Exception {
|
||
List<TgeneSubProductInstallmentCharges> lObjects = null;
|
||
Query qry = pEntityManager.createQuery(HQL_INSTALLMENT_CHARGES);
|
||
qry.setParameter("modulecode", pModuleCode);
|
||
qry.setParameter("productcode", pProductCode);
|
||
qry.setParameter("subproductcode", pSubproductCode);
|
||
qry.setParameter("statuscode", pStatusCode);
|
||
qry.setParameter("currencycode", pCurrencyCode);
|
||
lObjects = qry.getResultList();
|
||
return lObjects;
|
||
}
|
||
|
||
}
|