243 lines
7.7 KiB
Plaintext
Executable File
243 lines
7.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 TGENESOLICITUDEINSTALLCHARGES*/
|
||
@Entity(name="TgeneSolicitudeInstallCharges")
|
||
@Table(name="TGENESOLICITUDEINSTALLCHARGES")
|
||
public class TgeneSolicitudeInstallCharges 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 TgeneSolicitudeInstallCharges
|
||
*/
|
||
@EmbeddedId
|
||
private TgeneSolicitudeInstallChargesKey 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)
|
||
|
||
/**
|
||
* Orden de calculo de los cargos.
|
||
*/
|
||
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="VALUE", nullable=true)
|
||
|
||
/**
|
||
* Valor del cargo en la moneda de la operacion
|
||
*/
|
||
private BigDecimal value;
|
||
|
||
/**Contructor por defecto*/
|
||
public TgeneSolicitudeInstallCharges(){
|
||
}
|
||
/**Contructor de TgeneSolicitudeInstallCharges
|
||
@param pPk Clave Primaria del entity
|
||
*/
|
||
public TgeneSolicitudeInstallCharges(TgeneSolicitudeInstallChargesKey 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 TgeneSolicitudeInstallCharges
|
||
*/
|
||
public static TgeneSolicitudeInstallCharges find(EntityManager pEntityManager,TgeneSolicitudeInstallChargesKey pKey) throws Exception{
|
||
TgeneSolicitudeInstallCharges obj = pEntityManager.find(TgeneSolicitudeInstallCharges.class,pKey);
|
||
return obj;
|
||
}
|
||
/**Entrega la Clave primaria de TgeneSolicitudeInstallCharges
|
||
@return El objeto que referencia a la Clave primaria de TgeneSolicitudeInstallCharges
|
||
*/
|
||
public TgeneSolicitudeInstallChargesKey getPk(){
|
||
return pk;
|
||
}
|
||
/**Fija un nuevo valor a la Clave primaria de TgeneSolicitudeInstallCharges
|
||
@param pPk El objeto que referencia a la nueva Clave primaria de TgeneSolicitudeInstallCharges
|
||
*/
|
||
public void setPk(TgeneSolicitudeInstallChargesKey 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 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 TgeneSolicitudeInstallCharges))return false;
|
||
TgeneSolicitudeInstallCharges that = (TgeneSolicitudeInstallCharges) 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 TgeneSolicitudeInstallCharges
|
||
@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 TgeneSolicitudeInstallCharges
|
||
*/
|
||
public Object createInstance(){
|
||
TgeneSolicitudeInstallCharges instance=new TgeneSolicitudeInstallCharges();
|
||
instance.setPk(new TgeneSolicitudeInstallChargesKey());
|
||
return instance;
|
||
}
|
||
/**Clona la entidad TgeneSolicitudeInstallCharges
|
||
@see com.fp.dto.hb.HibernateBean#cloneMe()
|
||
*/
|
||
public Object cloneMe() throws CloneNotSupportedException{
|
||
TgeneSolicitudeInstallCharges p=(TgeneSolicitudeInstallCharges)this.clone();
|
||
p.setPk((TgeneSolicitudeInstallChargesKey)this.pk.cloneMe());
|
||
return p;
|
||
}
|
||
|
||
//Metodos manuales.
|
||
/**Sentencia que devuelve la definicion de cargos a adicionar a la tabla de amortizacion.*/
|
||
private static final String HQL_SOLICITUDE_INSTALLMENT_CHARGES =
|
||
"from TgeneSolicitudeInstallCharges t "
|
||
+ " where t.pk.solicitudnumber = :solicitudnumber "
|
||
+ " and t.pk.solicitudsequence = :solicitudsequence ";
|
||
|
||
/**
|
||
* Metodo que entrega una lista con los cargos a adicionar a la tabla de amortizacion para una solicitud.
|
||
* @param pSolicitudeNumber Numero de solicitud.
|
||
* @param pSolicitudeSequence Secuencia interna de la solicitud.
|
||
* @return List<TgeneSolicitudeInstallCharges>
|
||
* @throws Exception
|
||
*/
|
||
@SuppressWarnings("unchecked")
|
||
public static List<TgeneSolicitudeInstallCharges> find(EntityManager pEntityManager,String pSolicitudeNumber,
|
||
Integer pSolicitudeSequence) throws Exception {
|
||
List<TgeneSolicitudeInstallCharges> lObjects = null;
|
||
Query qry = pEntityManager.createQuery(HQL_SOLICITUDE_INSTALLMENT_CHARGES);
|
||
qry.setParameter("solicitudnumber", pSolicitudeNumber);
|
||
qry.setParameter("solicitudsequence", pSolicitudeSequence);
|
||
lObjects = qry.getResultList();
|
||
return lObjects;
|
||
}
|
||
|
||
}
|