309 lines
9.7 KiB
Plaintext
Executable File
309 lines
9.7 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 TGENESUBPRODUCTLIQUIDATION*/
|
||
@Entity(name="TgeneSubProductLiquidation")
|
||
@Table(name="TGENESUBPRODUCTLIQUIDATION")
|
||
public class TgeneSubProductLiquidation 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 TgeneSubProductLiquidation
|
||
*/
|
||
@EmbeddedId
|
||
private TgeneSubProductLiquidationKey pk;
|
||
@Column(name="CALCULATEORDER", nullable=true)
|
||
|
||
/**
|
||
* Orden de calculo de los cargos.
|
||
*/
|
||
private Integer calculateorder;
|
||
|
||
@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 del 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="INCREASE", nullable=true)
|
||
|
||
/**
|
||
* Indica que incrementa el valor de capital con el cual se genera la tabla de pagos
|
||
*/
|
||
private String increase;
|
||
|
||
@Column(name="DECREASE", nullable=true)
|
||
|
||
/**
|
||
* Indica que disminuye el valor de capital con el cual se genera la tabla de pagos
|
||
*/
|
||
private String decrease;
|
||
|
||
@Column(name="DECREASEDISBURSEMENT", nullable=true)
|
||
|
||
/**
|
||
* Indica que el valor del cargo se descuenta del monto a entregar al cliente
|
||
*/
|
||
private String decreasedisbursement;
|
||
|
||
@Column(name="ACTIVE", nullable=true)
|
||
|
||
/**
|
||
* null
|
||
*/
|
||
private String active;
|
||
|
||
/**Contructor por defecto*/
|
||
public TgeneSubProductLiquidation(){
|
||
}
|
||
/**Contructor de TgeneSubProductLiquidation
|
||
@param pPk Clave Primaria del entity
|
||
*/
|
||
public TgeneSubProductLiquidation(TgeneSubProductLiquidationKey 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 TgeneSubProductLiquidation
|
||
*/
|
||
public static TgeneSubProductLiquidation find(EntityManager pEntityManager,TgeneSubProductLiquidationKey pKey) throws Exception{
|
||
TgeneSubProductLiquidation obj = pEntityManager.find(TgeneSubProductLiquidation.class,pKey);
|
||
return obj;
|
||
}
|
||
/**Entrega la Clave primaria de TgeneSubProductLiquidation
|
||
@return El objeto que referencia a la Clave primaria de TgeneSubProductLiquidation
|
||
*/
|
||
public TgeneSubProductLiquidationKey getPk(){
|
||
return pk;
|
||
}
|
||
/**Fija un nuevo valor a la Clave primaria de TgeneSubProductLiquidation
|
||
@param pPk El objeto que referencia a la nueva Clave primaria de TgeneSubProductLiquidation
|
||
*/
|
||
public void setPk(TgeneSubProductLiquidationKey pPk){
|
||
pk=pPk;
|
||
}
|
||
/**Obtiene el valor de calculateorder
|
||
@return valor de calculateorder*/
|
||
public Integer getCalculateorder(){
|
||
return calculateorder;
|
||
}
|
||
/**Fija el valor de calculateorder
|
||
@param pCalculateorder nuevo Valor de calculateorder*/
|
||
public void setCalculateorder(Integer pCalculateorder){
|
||
calculateorder=pCalculateorder;
|
||
}
|
||
|
||
/**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 increase
|
||
@return valor de increase*/
|
||
public String getIncrease(){
|
||
return increase;
|
||
}
|
||
/**Fija el valor de increase
|
||
@param pIncrease nuevo Valor de increase*/
|
||
public void setIncrease(String pIncrease){
|
||
increase=pIncrease;
|
||
}
|
||
|
||
/**Obtiene el valor de decrease
|
||
@return valor de decrease*/
|
||
public String getDecrease(){
|
||
return decrease;
|
||
}
|
||
/**Fija el valor de decrease
|
||
@param pDecrease nuevo Valor de decrease*/
|
||
public void setDecrease(String pDecrease){
|
||
decrease=pDecrease;
|
||
}
|
||
|
||
/**Obtiene el valor de decreasedisbursement
|
||
@return valor de decreasedisbursement*/
|
||
public String getDecreasedisbursement(){
|
||
return decreasedisbursement;
|
||
}
|
||
/**Fija el valor de decreasedisbursement
|
||
@param pDecreasedisbursement nuevo Valor de decreasedisbursement*/
|
||
public void setDecreasedisbursement(String pDecreasedisbursement){
|
||
decreasedisbursement=pDecreasedisbursement;
|
||
}
|
||
|
||
/**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 TgeneSubProductLiquidation))return false;
|
||
TgeneSubProductLiquidation that = (TgeneSubProductLiquidation) 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 TgeneSubProductLiquidation
|
||
@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 TgeneSubProductLiquidation
|
||
*/
|
||
public Object createInstance(){
|
||
TgeneSubProductLiquidation instance=new TgeneSubProductLiquidation();
|
||
instance.setPk(new TgeneSubProductLiquidationKey());
|
||
return instance;
|
||
}
|
||
/**Clona la entidad TgeneSubProductLiquidation
|
||
@see com.fp.dto.hb.HibernateBean#cloneMe()
|
||
*/
|
||
public Object cloneMe() throws CloneNotSupportedException{
|
||
TgeneSubProductLiquidation p=(TgeneSubProductLiquidation)this.clone();
|
||
p.setPk((TgeneSubProductLiquidationKey)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_LIQUIDATION_CHARGES =
|
||
"from TgeneSubProductLiquidation tprodliq " +
|
||
" where tprodliq.pk.modulecode = :modulecode "+
|
||
" and tprodliq.pk.productcode = :productcode "+
|
||
" and tprodliq.pk.subproductcode = :subproductcode "+
|
||
" and tprodliq.pk.statuscode = :statuscode "+
|
||
" and tprodliq.pk.currencycode = :currencycode "+
|
||
" and tprodliq.active = 'Y' ";
|
||
|
||
|
||
/**
|
||
* Entrega una lista de cargos asociados a solicitud estos se pueden incrementar el valor del credito, o el
|
||
* cliente puede pagar en caja o con debito a la cuenta, o disminuir del valor a entregar al cliente.
|
||
* @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<TgeneSubProductLiquidation> find(EntityManager pEntityManager,
|
||
String pModuleCode,String pProductCode,
|
||
String pSubproductCode,String pStatusCode,String pCurrencyCode) throws Exception {
|
||
List<TgeneSubProductLiquidation> lObjects = null;
|
||
Query qry = pEntityManager.createQuery(HQL_LIQUIDATION_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;
|
||
}
|
||
|
||
}
|