334 lines
9.7 KiB
Plaintext
Executable File
334 lines
9.7 KiB
Plaintext
Executable File
package com.fp.persistence.pgeneral.gene;
|
||
|
||
import java.io.Serializable;
|
||
import java.lang.reflect.Field;
|
||
import java.math.BigDecimal;
|
||
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 TGENESOLICITUDELIQUIDATION*/
|
||
@Entity(name="TgeneSolicitudeLiquidation")
|
||
@Table(name="TGENESOLICITUDELIQUIDATION")
|
||
public class TgeneSolicitudeLiquidation 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 TgeneSolicitudeLiquidation
|
||
*/
|
||
@EmbeddedId
|
||
private TgeneSolicitudeLiquidationKey pk;
|
||
@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="CALCULATEORDER", nullable=true)
|
||
|
||
/**
|
||
* CALCULATEORDER
|
||
*/
|
||
private Integer calculateorder;
|
||
|
||
@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="CASH", nullable=true)
|
||
|
||
/**
|
||
* Indica que el valor se cobra en efectivo.
|
||
*/
|
||
private String cash;
|
||
|
||
@Column(name="DEBITACCOUNT", nullable=true)
|
||
|
||
/**
|
||
* Indica que el valor se cobra con debito a una cuneta, esta puede ser cuenta contable o cuenta a la vista
|
||
*/
|
||
private String debitaccount;
|
||
|
||
@Column(name="VALUE", nullable=true)
|
||
|
||
/**
|
||
* Valor del cargo en la moneda de la operacion
|
||
*/
|
||
private BigDecimal value;
|
||
|
||
/**Contructor por defecto*/
|
||
public TgeneSolicitudeLiquidation(){
|
||
}
|
||
/**Contructor de TgeneSolicitudeLiquidation
|
||
@param pPk Clave Primaria del entity
|
||
*/
|
||
public TgeneSolicitudeLiquidation(TgeneSolicitudeLiquidationKey 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 TgeneSolicitudeLiquidation
|
||
*/
|
||
public static TgeneSolicitudeLiquidation find(EntityManager pEntityManager,TgeneSolicitudeLiquidationKey pKey) throws Exception{
|
||
TgeneSolicitudeLiquidation obj = pEntityManager.find(TgeneSolicitudeLiquidation.class,pKey);
|
||
return obj;
|
||
}
|
||
/**Entrega la Clave primaria de TgeneSolicitudeLiquidation
|
||
@return El objeto que referencia a la Clave primaria de TgeneSolicitudeLiquidation
|
||
*/
|
||
public TgeneSolicitudeLiquidationKey getPk(){
|
||
return pk;
|
||
}
|
||
/**Fija un nuevo valor a la Clave primaria de TgeneSolicitudeLiquidation
|
||
@param pPk El objeto que referencia a la nueva Clave primaria de TgeneSolicitudeLiquidation
|
||
*/
|
||
public void setPk(TgeneSolicitudeLiquidationKey pPk){
|
||
pk=pPk;
|
||
}
|
||
/**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 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 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 cash
|
||
@return valor de cash*/
|
||
public String getCash(){
|
||
return cash;
|
||
}
|
||
/**Fija el valor de cash
|
||
@param pCash nuevo Valor de cash*/
|
||
public void setCash(String pCash){
|
||
cash=pCash;
|
||
}
|
||
|
||
/**Obtiene el valor de debitaccount
|
||
@return valor de debitaccount*/
|
||
public String getDebitaccount(){
|
||
return debitaccount;
|
||
}
|
||
/**Fija el valor de debitaccount
|
||
@param pDebitaccount nuevo Valor de debitaccount*/
|
||
public void setDebitaccount(String pDebitaccount){
|
||
debitaccount=pDebitaccount;
|
||
}
|
||
|
||
/**Obtiene el valor de value
|
||
@return valor de value*/
|
||
public BigDecimal getValue(){
|
||
return value;
|
||
}
|
||
/**Fija el valor de value
|
||
@param pValue nuevo Valor de value*/
|
||
public void setValue(BigDecimal pValue){
|
||
value=pValue;
|
||
}
|
||
|
||
public boolean equals(Object rhs){
|
||
if (rhs == null)return false;
|
||
if (! (rhs instanceof TgeneSolicitudeLiquidation))return false;
|
||
TgeneSolicitudeLiquidation that = (TgeneSolicitudeLiquidation) 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 TgeneSolicitudeLiquidation
|
||
@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 TgeneSolicitudeLiquidation
|
||
*/
|
||
public Object createInstance(){
|
||
TgeneSolicitudeLiquidation instance=new TgeneSolicitudeLiquidation();
|
||
instance.setPk(new TgeneSolicitudeLiquidationKey());
|
||
return instance;
|
||
}
|
||
/**Clona la entidad TgeneSolicitudeLiquidation
|
||
@see com.fp.dto.hb.HibernateBean#cloneMe()
|
||
*/
|
||
public Object cloneMe() throws CloneNotSupportedException{
|
||
TgeneSolicitudeLiquidation p=(TgeneSolicitudeLiquidation)this.clone();
|
||
p.setPk((TgeneSolicitudeLiquidationKey)this.pk.cloneMe());
|
||
return p;
|
||
}
|
||
|
||
//Metodos manuales.
|
||
/**Sentencia que devuelve uan lista con los valores a entregar al cliente asociados a una solicitud.*/
|
||
private static final String HQL_SOLICITUDE_LIQUIDATION =
|
||
" from TgeneSolicitudeLiquidation t " +
|
||
" where t.pk.solicitudnumber = :solicitudnumber "+
|
||
" and t.pk.solicitudsequence = :solicitudsequence ";
|
||
|
||
/**
|
||
* Metodo que entrega una lista con los cargos de liquidacion de una solicitud.
|
||
* @param pSolicitudNumber Numero de solicitud.
|
||
* @param pSolicitudSequence Secuencia dentro de la solicitud.
|
||
* @return List<TgeneSolicitudeLiquidation>
|
||
* @throws Exception
|
||
*/
|
||
@SuppressWarnings("unchecked")
|
||
public static List<TgeneSolicitudeLiquidation> find(EntityManager pEntityManager,
|
||
String pSolicitudNumber,Integer pSolicitudSequence) throws Exception {
|
||
List<TgeneSolicitudeLiquidation> lObjects = null;
|
||
Query qry = pEntityManager.createQuery(HQL_SOLICITUDE_LIQUIDATION);
|
||
qry.setParameter("solicitudnumber", pSolicitudNumber);
|
||
qry.setParameter("solicitudsequence", pSolicitudSequence);
|
||
lObjects = qry.getResultList();
|
||
return lObjects;
|
||
}
|
||
|
||
|
||
}
|