695 lines
18 KiB
Plaintext
Executable File
695 lines
18 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.Date;
|
||
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
|
||
* TCUSTPEOPLEVEHICLE
|
||
*/
|
||
@Entity(name = "TcustPeopleVehicle")
|
||
@Table(name = "TCUSTPEOPLEVEHICLE")
|
||
public class TcustPeopleVehicle 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 TcustPeopleVehicle
|
||
*/
|
||
@EmbeddedId
|
||
@GenericGenerator(name = "seq_id", strategy = "com.fp.general.keygen.SubSequenceKey", parameters = {
|
||
@Parameter(name = "sql", value = "select coalesce(max(VEHICLESEQUENCE),0)+1 from TCUSTPEOPLEVEHICLE where personcode=:code"),
|
||
@Parameter(name = "type", value = "java.lang.Integer"),
|
||
@Parameter(name = "param", value = "code,pk.personcode"),
|
||
@Parameter(name = "field", value = "vehiclesequence")})
|
||
@GeneratedValue(generator = "seq_id")
|
||
private TcustPeopleVehicleKey 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 = "VEHICLETYPECATALOG", nullable = true)
|
||
/**
|
||
* Codigo de catalogo 1 sedan, 2 coupe, 3 camioneta, 4 furgoneta, 5 suv
|
||
*/
|
||
private String vehicletypecatalog;
|
||
@Column(name = "VEHICLETYPECATALOGCODE", nullable = true)
|
||
/**
|
||
* Codigo de tabla de catalogo VEHICLETYPE tipo de vehiculo
|
||
*/
|
||
private String vehicletypecatalogcode;
|
||
@Column(name = "CARBRANDSCATALOG", nullable = true)
|
||
/**
|
||
* Codigo de catalogo 1, chevrolet, 2 Bmw, 3 Audi, 4 Ferrari
|
||
*/
|
||
private String carbrandscatalog;
|
||
@Column(name = "CARBRANDSCATALOGCODE", nullable = true)
|
||
/**
|
||
* Codigo de tabla de catalogo CARBRANDS, marca de auto
|
||
*/
|
||
private String carbrandscatalogcode;
|
||
@Column(name = "MODEL", nullable = true)
|
||
/**
|
||
* Modelo del vehiculo, ejemplo marca Mazda, modelo 323
|
||
*/
|
||
private String model;
|
||
@Column(name = "YEAR", nullable = true)
|
||
/**
|
||
* Anio de fabricacion del vehiculo
|
||
*/
|
||
private String year;
|
||
@Column(name = "MOTORID", nullable = true)
|
||
/**
|
||
* Numero de motor
|
||
*/
|
||
private String motorid;
|
||
@Column(name = "PLATE", nullable = true)
|
||
/**
|
||
* Numero de placa
|
||
*/
|
||
private String plate;
|
||
@Column(name = "COLOR", nullable = true)
|
||
/**
|
||
* Color del vehiculo
|
||
*/
|
||
private String color;
|
||
@Column(name = "ASSESSMENT", nullable = true)
|
||
/**
|
||
* Avaluo del vehiculo
|
||
*/
|
||
private BigDecimal assessment;
|
||
@Column(name = "CURRENCYCODE", nullable = true)
|
||
/**
|
||
* Codigo de moneda
|
||
*/
|
||
private String currencycode;
|
||
@Column(name = "INPUNTAMOUNT", nullable = true)
|
||
/**
|
||
* Valor de entrada
|
||
*/
|
||
private BigDecimal inpuntamount;
|
||
@Column(name = "PLEDGEDAMOUNT", nullable = true)
|
||
/**
|
||
* Valor financiado sobre el cual se constiruye la prenda
|
||
*/
|
||
private BigDecimal pledgedamount;
|
||
@Column(name = "PLEDGEDDATE", nullable = true)
|
||
/**
|
||
* Saldo del financiamiento
|
||
*/
|
||
private Date pledgeddate;
|
||
@Column(name = "PLEDGEDBALANCE", nullable = true)
|
||
/**
|
||
* Fecha en la que se ingreso el saldo de la deuda.
|
||
*/
|
||
private BigDecimal pledgedbalance;
|
||
@Column(name = "PLEDGEDPERSONCODE", nullable = true)
|
||
/**
|
||
* Codigo de persona poseedora de la prena del vehiculo
|
||
*/
|
||
private Integer pledgedpersoncode;
|
||
@Column(name = "PLEDGEDNAME", nullable = true)
|
||
/**
|
||
* Nombre la entidad beneficiaria de la prenda.
|
||
*/
|
||
private String pledgedname;
|
||
@Column(name = "REMARK", nullable = true)
|
||
/**
|
||
* Comentario, texto libre.
|
||
*/
|
||
private String remark;
|
||
@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 TcustPeopleVehicle() {
|
||
}
|
||
|
||
/**
|
||
* Contructor de TcustPeopleVehicle
|
||
*
|
||
* @param pPk Clave Primaria del entity
|
||
*/
|
||
public TcustPeopleVehicle(TcustPeopleVehicleKey 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 TcustPeopleVehicle
|
||
*/
|
||
public static TcustPeopleVehicle find(EntityManager pEntityManager, TcustPeopleVehicleKey pKey) throws Exception {
|
||
TcustPeopleVehicle obj = pEntityManager.find(TcustPeopleVehicle.class, pKey);
|
||
return obj;
|
||
}
|
||
|
||
/**
|
||
* Entrega la Clave primaria de TcustPeopleVehicle
|
||
*
|
||
* @return El objeto que referencia a la Clave primaria de
|
||
* TcustPeopleVehicle
|
||
*/
|
||
public TcustPeopleVehicleKey getPk() {
|
||
return this.pk;
|
||
}
|
||
|
||
/**
|
||
* Fija un nuevo valor a la Clave primaria de TcustPeopleVehicle
|
||
*
|
||
* @param pPk El objeto que referencia a la nueva Clave primaria de
|
||
* TcustPeopleVehicle
|
||
*/
|
||
public void setPk(TcustPeopleVehicleKey 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 vehicletypecatalog
|
||
*
|
||
* @return valor de vehicletypecatalog
|
||
*/
|
||
public String getVehicletypecatalog() {
|
||
return this.vehicletypecatalog;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de vehicletypecatalog
|
||
*
|
||
* @param pVehicletypecatalog nuevo Valor de vehicletypecatalog
|
||
*/
|
||
public void setVehicletypecatalog(String pVehicletypecatalog) {
|
||
this.vehicletypecatalog = pVehicletypecatalog;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de vehicletypecatalogcode
|
||
*
|
||
* @return valor de vehicletypecatalogcode
|
||
*/
|
||
public String getVehicletypecatalogcode() {
|
||
return this.vehicletypecatalogcode;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de vehicletypecatalogcode
|
||
*
|
||
* @param pVehicletypecatalogcode nuevo Valor de vehicletypecatalogcode
|
||
*/
|
||
public void setVehicletypecatalogcode(String pVehicletypecatalogcode) {
|
||
this.vehicletypecatalogcode = pVehicletypecatalogcode;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de carbrandscatalog
|
||
*
|
||
* @return valor de carbrandscatalog
|
||
*/
|
||
public String getCarbrandscatalog() {
|
||
return this.carbrandscatalog;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de carbrandscatalog
|
||
*
|
||
* @param pCarbrandscatalog nuevo Valor de carbrandscatalog
|
||
*/
|
||
public void setCarbrandscatalog(String pCarbrandscatalog) {
|
||
this.carbrandscatalog = pCarbrandscatalog;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de carbrandscatalogcode
|
||
*
|
||
* @return valor de carbrandscatalogcode
|
||
*/
|
||
public String getCarbrandscatalogcode() {
|
||
return this.carbrandscatalogcode;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de carbrandscatalogcode
|
||
*
|
||
* @param pCarbrandscatalogcode nuevo Valor de carbrandscatalogcode
|
||
*/
|
||
public void setCarbrandscatalogcode(String pCarbrandscatalogcode) {
|
||
this.carbrandscatalogcode = pCarbrandscatalogcode;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de model
|
||
*
|
||
* @return valor de model
|
||
*/
|
||
public String getModel() {
|
||
return this.model;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de model
|
||
*
|
||
* @param pModel nuevo Valor de model
|
||
*/
|
||
public void setModel(String pModel) {
|
||
this.model = pModel;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de year
|
||
*
|
||
* @return valor de year
|
||
*/
|
||
public String getYear() {
|
||
return this.year;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de year
|
||
*
|
||
* @param pYear nuevo Valor de year
|
||
*/
|
||
public void setYear(String pYear) {
|
||
this.year = pYear;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de motorid
|
||
*
|
||
* @return valor de motorid
|
||
*/
|
||
public String getMotorid() {
|
||
return this.motorid;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de motorid
|
||
*
|
||
* @param pMotorid nuevo Valor de motorid
|
||
*/
|
||
public void setMotorid(String pMotorid) {
|
||
this.motorid = pMotorid;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de plate
|
||
*
|
||
* @return valor de plate
|
||
*/
|
||
public String getPlate() {
|
||
return this.plate;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de plate
|
||
*
|
||
* @param pPlate nuevo Valor de plate
|
||
*/
|
||
public void setPlate(String pPlate) {
|
||
this.plate = pPlate;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de color
|
||
*
|
||
* @return valor de color
|
||
*/
|
||
public String getColor() {
|
||
return this.color;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de color
|
||
*
|
||
* @param pColor nuevo Valor de color
|
||
*/
|
||
public void setColor(String pColor) {
|
||
this.color = pColor;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de assessment
|
||
*
|
||
* @return valor de assessment
|
||
*/
|
||
public BigDecimal getAssessment() {
|
||
return this.assessment;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de assessment
|
||
*
|
||
* @param pAssessment nuevo Valor de assessment
|
||
*/
|
||
public void setAssessment(BigDecimal pAssessment) {
|
||
this.assessment = pAssessment;
|
||
}
|
||
|
||
/**
|
||
* 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 inpuntamount
|
||
*
|
||
* @return valor de inpuntamount
|
||
*/
|
||
public BigDecimal getInpuntamount() {
|
||
return this.inpuntamount;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de inpuntamount
|
||
*
|
||
* @param pInpuntamount nuevo Valor de inpuntamount
|
||
*/
|
||
public void setInpuntamount(BigDecimal pInpuntamount) {
|
||
this.inpuntamount = pInpuntamount;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de pledgedamount
|
||
*
|
||
* @return valor de pledgedamount
|
||
*/
|
||
public BigDecimal getPledgedamount() {
|
||
return this.pledgedamount;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de pledgedamount
|
||
*
|
||
* @param pPledgedamount nuevo Valor de pledgedamount
|
||
*/
|
||
public void setPledgedamount(BigDecimal pPledgedamount) {
|
||
this.pledgedamount = pPledgedamount;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de pledgeddate
|
||
*
|
||
* @return valor de pledgeddate
|
||
*/
|
||
public Date getPledgeddate() {
|
||
return this.pledgeddate;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de pledgeddate
|
||
*
|
||
* @param pPledgeddate nuevo Valor de pledgeddate
|
||
*/
|
||
public void setPledgeddate(Date pPledgeddate) {
|
||
this.pledgeddate = pPledgeddate;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de pledgedbalance
|
||
*
|
||
* @return valor de pledgedbalance
|
||
*/
|
||
public BigDecimal getPledgedbalance() {
|
||
return this.pledgedbalance;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de pledgedbalance
|
||
*
|
||
* @param pPledgedbalance nuevo Valor de pledgedbalance
|
||
*/
|
||
public void setPledgedbalance(BigDecimal pPledgedbalance) {
|
||
this.pledgedbalance = pPledgedbalance;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de pledgedpersoncode
|
||
*
|
||
* @return valor de pledgedpersoncode
|
||
*/
|
||
public Integer getPledgedpersoncode() {
|
||
return this.pledgedpersoncode;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de pledgedpersoncode
|
||
*
|
||
* @param pPledgedpersoncode nuevo Valor de pledgedpersoncode
|
||
*/
|
||
public void setPledgedpersoncode(Integer pPledgedpersoncode) {
|
||
this.pledgedpersoncode = pPledgedpersoncode;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de pledgedname
|
||
*
|
||
* @return valor de pledgedname
|
||
*/
|
||
public String getPledgedname() {
|
||
return this.pledgedname;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de pledgedname
|
||
*
|
||
* @param pPledgedname nuevo Valor de pledgedname
|
||
*/
|
||
public void setPledgedname(String pPledgedname) {
|
||
this.pledgedname = pPledgedname;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de remark
|
||
*
|
||
* @return valor de remark
|
||
*/
|
||
public String getRemark() {
|
||
return this.remark;
|
||
}
|
||
|
||
/**
|
||
* Fija el valor de remark
|
||
*
|
||
* @param pRemark nuevo Valor de remark
|
||
*/
|
||
public void setRemark(String pRemark) {
|
||
this.remark = pRemark;
|
||
}
|
||
|
||
/**
|
||
* 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 TcustPeopleVehicle)) {
|
||
return false;
|
||
}
|
||
TcustPeopleVehicle that = (TcustPeopleVehicle) 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 TcustPeopleVehicle
|
||
*
|
||
* @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 TcustPeopleVehicle
|
||
*/
|
||
@Override
|
||
public Object createInstance() {
|
||
TcustPeopleVehicle instance = new TcustPeopleVehicle();
|
||
instance.setPk(new TcustPeopleVehicleKey());
|
||
return instance;
|
||
}
|
||
|
||
/**
|
||
* Clona la entidad TcustPeopleVehicle
|
||
*
|
||
* @see com.fp.dto.hb.HibernateBean#cloneMe()
|
||
*/
|
||
@Override
|
||
public Object cloneMe() throws CloneNotSupportedException {
|
||
TcustPeopleVehicle p = (TcustPeopleVehicle) this.clone();
|
||
p.setPk((TcustPeopleVehicleKey) this.pk.cloneMe());
|
||
return p;
|
||
}
|
||
|
||
public Object getId() {
|
||
return this.pk;
|
||
}
|
||
}
|