574 lines
15 KiB
Plaintext
Executable File
574 lines
15 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 TCUSTPEOPLETRADEREFERENCES
|
||
*/
|
||
@Entity(name = "TcustPeopleTradereferences")
|
||
@Table(name = "TCUSTPEOPLETRADEREFERENCES")
|
||
public class TcustPeopleTradereferences 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 TcustPeopleTradereferences
|
||
*/
|
||
@EmbeddedId
|
||
@GenericGenerator(name = "seq_id", strategy = "com.fp.general.keygen.SubSequenceKey", parameters = {
|
||
@Parameter(name = "sql", value = "select coalesce(max(TRADESEQUENCE),0)+1 from TCUSTPEOPLETRADEREFERENCES where personcode=:code"),
|
||
@Parameter(name = "type", value = "java.lang.Integer"), @Parameter(name = "param", value = "code,pk.personcode"),
|
||
@Parameter(name = "field", value = "tradesequence") })
|
||
@GeneratedValue(generator = "seq_id")
|
||
private TcustPeopleTradereferencesKey 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 = "ITEM", nullable = true)
|
||
/**
|
||
* Descripcion del articulo comprado.
|
||
*/
|
||
private String item;
|
||
|
||
@Column(name = "PURCHASEYEAR", nullable = true)
|
||
/**
|
||
* Anio en que se realizo la compra
|
||
*/
|
||
private String purchaseyear;
|
||
|
||
@Column(name = "PAYMENTMETHODCATALOG", nullable = true)
|
||
/**
|
||
* Codigo de catalogo de metodo de pago 1 Efectivo, 2 Cheques, 3 tarjeta de
|
||
* credito
|
||
*/
|
||
private String paymentmethodcatalog;
|
||
|
||
@Column(name = "PAYMENTMETHODCATALOGCODE", nullable = true)
|
||
/**
|
||
* Codigo de tabla de catalogo PAYMENTMETHOD, metodo de pago
|
||
*/
|
||
private String paymentmethodcatalogcode;
|
||
|
||
@Column(name = "CURRENCYCODE", nullable = true)
|
||
/**
|
||
* Codigo de moneda de la compra
|
||
*/
|
||
private String currencycode;
|
||
|
||
@Column(name = "AMOUNT", nullable = true)
|
||
/**
|
||
* Monto total de la compra
|
||
*/
|
||
private BigDecimal amount;
|
||
|
||
@Column(name = "INPUTAMOUNT", nullable = true)
|
||
/**
|
||
* Monto de entrada
|
||
*/
|
||
private BigDecimal inputamount;
|
||
|
||
@Column(name = "QUOTASNUMBER", nullable = true)
|
||
/**
|
||
* Numero de cuotas pactadas si se compro a plazo
|
||
*/
|
||
private Integer quotasnumber;
|
||
|
||
@Column(name = "QUOTAVALUE", nullable = true)
|
||
/**
|
||
* Monto de la cuota pactada
|
||
*/
|
||
private BigDecimal quotavalue;
|
||
|
||
@Column(name = "TRADEPERSONCODE", nullable = true)
|
||
/**
|
||
* Codigo de persona asociada a la empresa casa cmercial en donde el cliente
|
||
* realizo la compra
|
||
*/
|
||
private Integer tradepersoncode;
|
||
|
||
@Column(name = "TRADENAME", nullable = true)
|
||
/**
|
||
* Nombre del establesimiento comercial, si no esta registrado en la base de
|
||
* personas
|
||
*/
|
||
private String tradename;
|
||
|
||
@Column(name = "TRADEPHONE", nullable = true)
|
||
/**
|
||
* Telefono asociado al establesimiento comercial si no esta registrado como
|
||
* una persona
|
||
*/
|
||
private String tradephone;
|
||
|
||
@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 TcustPeopleTradereferences() {
|
||
}
|
||
|
||
/**
|
||
* Contructor de TcustPeopleTradereferences
|
||
*
|
||
* @param pPk Clave Primaria del entity
|
||
*/
|
||
public TcustPeopleTradereferences(TcustPeopleTradereferencesKey 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 TcustPeopleTradereferences
|
||
*/
|
||
public static TcustPeopleTradereferences find(EntityManager pEntityManager, TcustPeopleTradereferencesKey pKey) throws Exception {
|
||
TcustPeopleTradereferences obj = pEntityManager.find(TcustPeopleTradereferences.class, pKey);
|
||
return obj;
|
||
}
|
||
|
||
/**
|
||
* Entrega la Clave primaria de TcustPeopleTradereferences
|
||
*
|
||
* @return El objeto que referencia a la Clave primaria de TcustPeopleTradereferences
|
||
*/
|
||
public TcustPeopleTradereferencesKey getPk() {
|
||
return this.pk;
|
||
}
|
||
|
||
/**
|
||
* Fija un nuevo valor a la Clave primaria de TcustPeopleTradereferences
|
||
*
|
||
* @param pPk El objeto que referencia a la nueva Clave primaria de TcustPeopleTradereferences
|
||
*/
|
||
public void setPk(TcustPeopleTradereferencesKey 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 item
|
||
*
|
||
* @return valor de item
|
||
*/
|
||
public String getItem() {
|
||
return this.item;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de item
|
||
*
|
||
* @param pItem nuevo Valor de item
|
||
*/
|
||
public void setItem(String pItem) {
|
||
this.item = pItem;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de purchaseyear
|
||
*
|
||
* @return valor de purchaseyear
|
||
*/
|
||
public String getPurchaseyear() {
|
||
return this.purchaseyear;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de purchaseyear
|
||
*
|
||
* @param pPurchaseyear nuevo Valor de purchaseyear
|
||
*/
|
||
public void setPurchaseyear(String pPurchaseyear) {
|
||
this.purchaseyear = pPurchaseyear;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de paymentmethodcatalog
|
||
*
|
||
* @return valor de paymentmethodcatalog
|
||
*/
|
||
public String getPaymentmethodcatalog() {
|
||
return this.paymentmethodcatalog;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de paymentmethodcatalog
|
||
*
|
||
* @param pPaymentmethodcatalog nuevo Valor de paymentmethodcatalog
|
||
*/
|
||
public void setPaymentmethodcatalog(String pPaymentmethodcatalog) {
|
||
this.paymentmethodcatalog = pPaymentmethodcatalog;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de paymentmethodcatalogcode
|
||
*
|
||
* @return valor de paymentmethodcatalogcode
|
||
*/
|
||
public String getPaymentmethodcatalogcode() {
|
||
return this.paymentmethodcatalogcode;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de paymentmethodcatalogcode
|
||
*
|
||
* @param pPaymentmethodcatalogcode nuevo Valor de paymentmethodcatalogcode
|
||
*/
|
||
public void setPaymentmethodcatalogcode(String pPaymentmethodcatalogcode) {
|
||
this.paymentmethodcatalogcode = pPaymentmethodcatalogcode;
|
||
}
|
||
|
||
/**
|
||
* 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 inputamount
|
||
*
|
||
* @return valor de inputamount
|
||
*/
|
||
public BigDecimal getInputamount() {
|
||
return this.inputamount;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de inputamount
|
||
*
|
||
* @param pInputamount nuevo Valor de inputamount
|
||
*/
|
||
public void setInputamount(BigDecimal pInputamount) {
|
||
this.inputamount = pInputamount;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de quotasnumber
|
||
*
|
||
* @return valor de quotasnumber
|
||
*/
|
||
public Integer getQuotasnumber() {
|
||
return this.quotasnumber;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de quotasnumber
|
||
*
|
||
* @param pQuotasnumber nuevo Valor de quotasnumber
|
||
*/
|
||
public void setQuotasnumber(Integer pQuotasnumber) {
|
||
this.quotasnumber = pQuotasnumber;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de quotavalue
|
||
*
|
||
* @return valor de quotavalue
|
||
*/
|
||
public BigDecimal getQuotavalue() {
|
||
return this.quotavalue;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de quotavalue
|
||
*
|
||
* @param pQuotavalue nuevo Valor de quotavalue
|
||
*/
|
||
public void setQuotavalue(BigDecimal pQuotavalue) {
|
||
this.quotavalue = pQuotavalue;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de tradepersoncode
|
||
*
|
||
* @return valor de tradepersoncode
|
||
*/
|
||
public Integer getTradepersoncode() {
|
||
return this.tradepersoncode;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de tradepersoncode
|
||
*
|
||
* @param pTradepersoncode nuevo Valor de tradepersoncode
|
||
*/
|
||
public void setTradepersoncode(Integer pTradepersoncode) {
|
||
this.tradepersoncode = pTradepersoncode;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de tradename
|
||
*
|
||
* @return valor de tradename
|
||
*/
|
||
public String getTradename() {
|
||
return this.tradename;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de tradename
|
||
*
|
||
* @param pTradename nuevo Valor de tradename
|
||
*/
|
||
public void setTradename(String pTradename) {
|
||
this.tradename = pTradename;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de tradephone
|
||
*
|
||
* @return valor de tradephone
|
||
*/
|
||
public String getTradephone() {
|
||
return this.tradephone;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de tradephone
|
||
*
|
||
* @param pTradephone nuevo Valor de tradephone
|
||
*/
|
||
public void setTradephone(String pTradephone) {
|
||
this.tradephone = pTradephone;
|
||
}
|
||
|
||
/**
|
||
* 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 TcustPeopleTradereferences)) {
|
||
return false;
|
||
}
|
||
TcustPeopleTradereferences that = (TcustPeopleTradereferences) 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 TcustPeopleTradereferences
|
||
*
|
||
* @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 TcustPeopleTradereferences
|
||
*/
|
||
@Override
|
||
public Object createInstance() {
|
||
TcustPeopleTradereferences instance = new TcustPeopleTradereferences();
|
||
instance.setPk(new TcustPeopleTradereferencesKey());
|
||
return instance;
|
||
}
|
||
|
||
/**
|
||
* Clona la entidad TcustPeopleTradereferences
|
||
*
|
||
* @see com.fp.dto.hb.HibernateBean#cloneMe()
|
||
*/
|
||
@Override
|
||
public Object cloneMe() throws CloneNotSupportedException {
|
||
TcustPeopleTradereferences p = (TcustPeopleTradereferences) this.clone();
|
||
p.setPk((TcustPeopleTradereferencesKey) this.pk.cloneMe());
|
||
return p;
|
||
}
|
||
|
||
public Object getId() {
|
||
return this.pk;
|
||
}
|
||
}
|