183 lines
5.2 KiB
Plaintext
Executable File
183 lines
5.2 KiB
Plaintext
Executable File
package com.fp.persistence.pgeneral.gene;
|
|
|
|
import javax.persistence.EmbeddedId;
|
|
import javax.persistence.Entity;
|
|
import java.sql.Timestamp;
|
|
import javax.persistence.Column;
|
|
import javax.persistence.EntityManager;
|
|
import java.io.Serializable;
|
|
import java.math.BigDecimal;
|
|
import javax.persistence.Table;
|
|
import com.fp.dto.hb.HibernateBean;
|
|
import java.lang.reflect.Field;
|
|
import javax.persistence.Transient;
|
|
|
|
/**Clase que implementa la entidad de Hibernate que hace referencia a la tabla TGENETECHNICALPATRIMONY*/
|
|
@Entity(name="TgeneTechnicalPatrimony")
|
|
@Table(name="TGENETECHNICALPATRIMONY")
|
|
public class TgeneTechnicalPatrimony 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 TgeneTechnicalPatrimony
|
|
*/
|
|
@EmbeddedId
|
|
private TgeneTechnicalPatrimonyKey pk;
|
|
@Column(name="PERSONCODE", nullable=true)
|
|
|
|
/**
|
|
* Codigo de persona
|
|
*/
|
|
private Integer personcode;
|
|
|
|
@Column(name="AMOUNT", nullable=true)
|
|
|
|
/**
|
|
* Monto del patrimonio técnico
|
|
*/
|
|
private BigDecimal amount;
|
|
|
|
@Column(name="DATEFROM", nullable=false)
|
|
|
|
/**
|
|
* Fecha desde la cual esta vigente el registro de datos del prestamo
|
|
*/
|
|
private Timestamp datefrom;
|
|
|
|
/**Contructor por defecto*/
|
|
public TgeneTechnicalPatrimony(){
|
|
}
|
|
/**Contructor de TgeneTechnicalPatrimony
|
|
@param pPk Clave Primaria del entity
|
|
@param pDatefrom Fecha desde la cual esta vigente el registro de datos del prestamo
|
|
*/
|
|
public TgeneTechnicalPatrimony(TgeneTechnicalPatrimonyKey pPk,Timestamp pDatefrom){
|
|
this();
|
|
pk=pPk;
|
|
datefrom=pDatefrom;
|
|
}
|
|
/**
|
|
* 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 TgeneTechnicalPatrimony
|
|
*/
|
|
public static TgeneTechnicalPatrimony find(EntityManager pEntityManager,TgeneTechnicalPatrimonyKey pKey) throws Exception{
|
|
TgeneTechnicalPatrimony obj = pEntityManager.find(TgeneTechnicalPatrimony.class,pKey);
|
|
return obj;
|
|
}
|
|
/**Entrega la Clave primaria de TgeneTechnicalPatrimony
|
|
@return El objeto que referencia a la Clave primaria de TgeneTechnicalPatrimony
|
|
*/
|
|
public TgeneTechnicalPatrimonyKey getPk(){
|
|
return pk;
|
|
}
|
|
/**Fija un nuevo valor a la Clave primaria de TgeneTechnicalPatrimony
|
|
@param pPk El objeto que referencia a la nueva Clave primaria de TgeneTechnicalPatrimony
|
|
*/
|
|
public void setPk(TgeneTechnicalPatrimonyKey pPk){
|
|
pk=pPk;
|
|
}
|
|
/**Obtiene el valor de personcode
|
|
@return valor de personcode*/
|
|
public Integer getPersoncode(){
|
|
return personcode;
|
|
}
|
|
/**Fija el valor de personcode
|
|
@param pPersoncode nuevo Valor de personcode*/
|
|
public void setPersoncode(Integer pPersoncode){
|
|
personcode=pPersoncode;
|
|
}
|
|
|
|
/**Obtiene el valor de amount
|
|
@return valor de amount*/
|
|
public BigDecimal getAmount(){
|
|
return amount;
|
|
}
|
|
/**Fija el valor de amount
|
|
@param pAmount nuevo Valor de amount*/
|
|
public void setAmount(BigDecimal pAmount){
|
|
amount=pAmount;
|
|
}
|
|
|
|
/**Obtiene el valor de datefrom
|
|
@return valor de datefrom*/
|
|
public Timestamp getDatefrom(){
|
|
return datefrom;
|
|
}
|
|
/**Fija el valor de datefrom
|
|
@param pDatefrom nuevo Valor de datefrom*/
|
|
public void setDatefrom(Timestamp pDatefrom){
|
|
datefrom=pDatefrom;
|
|
}
|
|
|
|
public boolean equals(Object rhs){
|
|
if (rhs == null)return false;
|
|
if (! (rhs instanceof TgeneTechnicalPatrimony))return false;
|
|
TgeneTechnicalPatrimony that = (TgeneTechnicalPatrimony) rhs;
|
|
if (this.getPk() == null || that.getPk() == null)
|
|
return false;
|
|
return (this.getPk().equals(that.getPk()));
|
|
}
|
|
/**Implementacion del metodo hashCode de la la entidad TgeneTechnicalPatrimony
|
|
@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;
|
|
}
|
|
/**Implementacion 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;
|
|
}
|
|
/**Implementacion de la creacion de un bean en blanco TgeneTechnicalPatrimony
|
|
*/
|
|
public Object createInstance(){
|
|
TgeneTechnicalPatrimony instance=new TgeneTechnicalPatrimony();
|
|
instance.setPk(new TgeneTechnicalPatrimonyKey());
|
|
return instance;
|
|
}
|
|
/**Clona la entidad TgeneTechnicalPatrimony
|
|
@see com.fp.dto.hb.HibernateBean#cloneMe()
|
|
*/
|
|
public Object cloneMe() throws CloneNotSupportedException{
|
|
TgeneTechnicalPatrimony p=(TgeneTechnicalPatrimony)this.clone();
|
|
p.setPk((TgeneTechnicalPatrimonyKey)this.pk.cloneMe());
|
|
return p;
|
|
}
|
|
public Object getId() {
|
|
return this.pk;
|
|
}
|
|
}
|