417 lines
11 KiB
Plaintext
Executable File
417 lines
11 KiB
Plaintext
Executable File
package com.fp.persistence.pcustomer.people;
|
||
|
||
import java.io.Serializable;
|
||
import java.lang.reflect.Field;
|
||
import java.math.BigDecimal;
|
||
import java.sql.Timestamp;
|
||
|
||
import javax.persistence.Column;
|
||
import javax.persistence.EmbeddedId;
|
||
import javax.persistence.Entity;
|
||
import javax.persistence.EntityManager;
|
||
import javax.persistence.GeneratedValue;
|
||
import javax.persistence.Table;
|
||
import javax.persistence.Transient;
|
||
import javax.persistence.Version;
|
||
|
||
import org.hibernate.annotations.GenericGenerator;
|
||
import org.hibernate.annotations.Parameter;
|
||
|
||
import com.fp.dto.hb.HibernateBean;
|
||
import com.fp.dto.hb.Log;
|
||
|
||
/**
|
||
* Clase que implementa la entidad de Hibernate que hace referencia a la tabla
|
||
* TCUSTPEOPLEINCOME
|
||
*/
|
||
@Entity(name = "TcustPeopleIncome")
|
||
@Table(name = "TCUSTPEOPLEINCOME")
|
||
public class TcustPeopleIncome extends com.fp.dto.AbstractDataTransport implements Serializable, HibernateBean, Cloneable, Log {
|
||
|
||
/**
|
||
* 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 TcustPeopleIncome
|
||
*/
|
||
@EmbeddedId
|
||
@GenericGenerator(name = "seq_id", strategy = "com.fp.general.keygen.SubSequenceKey", parameters = {
|
||
@Parameter(name = "sql", value = "select coalesce(max(INCOMESEQUENCE),0)+1 from TCUSTPEOPLEINCOME where personcode=:code"),
|
||
@Parameter(name = "type", value = "java.lang.Integer"),
|
||
@Parameter(name = "param", value = "code,pk.personcode"),
|
||
@Parameter(name = "field", value = "incomesequence")})
|
||
@GeneratedValue(generator = "seq_id")
|
||
private TcustPeopleIncomeKey pk;
|
||
@Column(name = "DATEFROM", nullable = true)
|
||
/**
|
||
* Fecha desde la cual esta vigente el registro
|
||
*/
|
||
private Timestamp datefrom;
|
||
@Version
|
||
@Column(name = "RECORDVERSION", nullable = true)
|
||
/**
|
||
* Optimistic locking del registro
|
||
*/
|
||
private Integer recordversion;
|
||
@Column(name = "INCOMESCATALOG", nullable = true)
|
||
/**
|
||
* Codigo de catalogo de ingresos 1 sueldo, 2 comisiones
|
||
*/
|
||
private String incomescatalog;
|
||
@Column(name = "INCOMESCATALOGCODE", nullable = true)
|
||
/**
|
||
* Codigo de tabla de catalogo INCOMES DE INGRESOS
|
||
*/
|
||
private String incomescatalogcode;
|
||
@Column(name = "CURRENCYCODE", nullable = true)
|
||
/**
|
||
* Codigo de moneda
|
||
*/
|
||
private String currencycode;
|
||
@Column(name = "AMOUNT", nullable = true)
|
||
/**
|
||
* Valor del ingreso mensual
|
||
*/
|
||
private BigDecimal amount;
|
||
@Column(name = "ISFIXVALUE", nullable = true)
|
||
/**
|
||
* Y indica que un valor de ingreso fijo, N no es un ingreso fijo
|
||
*/
|
||
private String isfixvalue;
|
||
@Column(name = "VERIFIEDAMOUNT", nullable = true)
|
||
/**
|
||
* Monto verificado por una persona de la institucion financiera
|
||
*/
|
||
private BigDecimal verifiedamount;
|
||
@Column(name = "INGRESSUSERCODE", nullable = true)
|
||
/**
|
||
* Codigo de usuario
|
||
*/
|
||
private String ingressusercode;
|
||
@Column(name = "MODIFYUSERCODE", nullable = true)
|
||
/**
|
||
* Codigo de usuario
|
||
*/
|
||
private String modifyusercode;
|
||
|
||
/**
|
||
* Contructor por defecto
|
||
*/
|
||
public TcustPeopleIncome() {
|
||
}
|
||
|
||
/**
|
||
* Contructor de TcustPeopleIncome
|
||
*
|
||
* @param pPk Clave Primaria del entity
|
||
*/
|
||
public TcustPeopleIncome(TcustPeopleIncomeKey pPk) {
|
||
this();
|
||
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 TcustPeopleIncome
|
||
*/
|
||
public static TcustPeopleIncome find(EntityManager pEntityManager, TcustPeopleIncomeKey pKey) throws Exception {
|
||
TcustPeopleIncome obj = pEntityManager.find(TcustPeopleIncome.class, pKey);
|
||
return obj;
|
||
}
|
||
|
||
/**
|
||
* Entrega la Clave primaria de TcustPeopleIncome
|
||
*
|
||
* @return El objeto que referencia a la Clave primaria de TcustPeopleIncome
|
||
*/
|
||
public TcustPeopleIncomeKey getPk() {
|
||
return this.pk;
|
||
}
|
||
|
||
/**
|
||
* Fija un nuevo valor a la Clave primaria de TcustPeopleIncome
|
||
*
|
||
* @param pPk El objeto que referencia a la nueva Clave primaria de
|
||
* TcustPeopleIncome
|
||
*/
|
||
public void setPk(TcustPeopleIncomeKey pPk) {
|
||
this.pk = pPk;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de datefrom
|
||
*
|
||
* @return valor de datefrom
|
||
*/
|
||
public Timestamp getDatefrom() {
|
||
return this.datefrom;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de datefrom
|
||
*
|
||
* @param pDatefrom nuevo Valor de datefrom
|
||
*/
|
||
public void setDatefrom(Timestamp pDatefrom) {
|
||
this.datefrom = pDatefrom;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de recordversion
|
||
*
|
||
* @return valor de recordversion
|
||
*/
|
||
public Integer getRecordversion() {
|
||
return this.recordversion;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de recordversion
|
||
*
|
||
* @param pRecordversion nuevo Valor de recordversion
|
||
*/
|
||
public void setRecordversion(Integer pRecordversion) {
|
||
this.recordversion = pRecordversion;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de incomescatalog
|
||
*
|
||
* @return valor de incomescatalog
|
||
*/
|
||
public String getIncomescatalog() {
|
||
return this.incomescatalog;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de incomescatalog
|
||
*
|
||
* @param pIncomescatalog nuevo Valor de incomescatalog
|
||
*/
|
||
public void setIncomescatalog(String pIncomescatalog) {
|
||
this.incomescatalog = pIncomescatalog;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de incomescatalogcode
|
||
*
|
||
* @return valor de incomescatalogcode
|
||
*/
|
||
public String getIncomescatalogcode() {
|
||
return this.incomescatalogcode;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de incomescatalogcode
|
||
*
|
||
* @param pIncomescatalogcode nuevo Valor de incomescatalogcode
|
||
*/
|
||
public void setIncomescatalogcode(String pIncomescatalogcode) {
|
||
this.incomescatalogcode = pIncomescatalogcode;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de currencycode
|
||
*
|
||
* @return valor de currencycode
|
||
*/
|
||
public String getCurrencycode() {
|
||
return this.currencycode;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de currencycode
|
||
*
|
||
* @param pCurrencycode nuevo Valor de currencycode
|
||
*/
|
||
public void setCurrencycode(String pCurrencycode) {
|
||
this.currencycode = pCurrencycode;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de amount
|
||
*
|
||
* @return valor de amount
|
||
*/
|
||
public BigDecimal getAmount() {
|
||
return this.amount;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de amount
|
||
*
|
||
* @param pAmount nuevo Valor de amount
|
||
*/
|
||
public void setAmount(BigDecimal pAmount) {
|
||
this.amount = pAmount;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de isfixvalue
|
||
*
|
||
* @return valor de isfixvalue
|
||
*/
|
||
public String getIsfixvalue() {
|
||
return this.isfixvalue;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de isfixvalue
|
||
*
|
||
* @param pIsfixvalue nuevo Valor de isfixvalue
|
||
*/
|
||
public void setIsfixvalue(String pIsfixvalue) {
|
||
this.isfixvalue = pIsfixvalue;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de verifiedamount
|
||
*
|
||
* @return valor de verifiedamount
|
||
*/
|
||
public BigDecimal getVerifiedamount() {
|
||
return this.verifiedamount;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de verifiedamount
|
||
*
|
||
* @param pVerifiedamount nuevo Valor de verifiedamount
|
||
*/
|
||
public void setVerifiedamount(BigDecimal pVerifiedamount) {
|
||
this.verifiedamount = pVerifiedamount;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de ingressusercode
|
||
*
|
||
* @return valor de ingressusercode
|
||
*/
|
||
public String getIngressusercode() {
|
||
return this.ingressusercode;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de ingressusercode
|
||
*
|
||
* @param pIngressusercode nuevo Valor de ingressusercode
|
||
*/
|
||
public void setIngressusercode(String pIngressusercode) {
|
||
this.ingressusercode = pIngressusercode;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de modifyusercode
|
||
*
|
||
* @return valor de modifyusercode
|
||
*/
|
||
public String getModifyusercode() {
|
||
return this.modifyusercode;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de modifyusercode
|
||
*
|
||
* @param pModifyusercode nuevo Valor de modifyusercode
|
||
*/
|
||
public void setModifyusercode(String pModifyusercode) {
|
||
this.modifyusercode = pModifyusercode;
|
||
}
|
||
|
||
@Override
|
||
public boolean equals(Object rhs) {
|
||
if (rhs == null) {
|
||
return false;
|
||
}
|
||
if (!(rhs instanceof TcustPeopleIncome)) {
|
||
return false;
|
||
}
|
||
TcustPeopleIncome that = (TcustPeopleIncome) 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 TcustPeopleIncome
|
||
*
|
||
* @return el hashCode la instancia
|
||
*/
|
||
@Override
|
||
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
|
||
*/
|
||
@Override
|
||
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 TcustPeopleIncome
|
||
*/
|
||
@Override
|
||
public Object createInstance() {
|
||
TcustPeopleIncome instance = new TcustPeopleIncome();
|
||
instance.setPk(new TcustPeopleIncomeKey());
|
||
return instance;
|
||
}
|
||
|
||
/**
|
||
* Clona la entidad TcustPeopleIncome
|
||
*
|
||
* @see com.fp.dto.hb.HibernateBean#cloneMe()
|
||
*/
|
||
@Override
|
||
public Object cloneMe() throws CloneNotSupportedException {
|
||
TcustPeopleIncome p = (TcustPeopleIncome) this.clone();
|
||
p.setPk((TcustPeopleIncomeKey) this.pk.cloneMe());
|
||
return p;
|
||
}
|
||
|
||
public Object getId() {
|
||
return this.pk;
|
||
}
|
||
}
|