194 lines
5.1 KiB
Plaintext
Executable File
194 lines
5.1 KiB
Plaintext
Executable File
package com.fp.persistence.pcustomer.company;
|
|
|
|
import javax.persistence.Entity;
|
|
import com.fp.dto.hb.Log;
|
|
import javax.persistence.Id;
|
|
import javax.persistence.Column;
|
|
import javax.persistence.EntityManager;
|
|
import java.io.Serializable;
|
|
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 TCUSTSUPERVISOR*/
|
|
@Entity(name="TcustSupervisor")
|
|
@Table(name="TCUSTSUPERVISOR")
|
|
public class TcustSupervisor 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 TcustSupervisor
|
|
*/
|
|
@Id
|
|
@Column(name="PERSONCODE" ,nullable=false, updatable=false)
|
|
private Integer pk;
|
|
@Column(name="CODEFILE", nullable=true)
|
|
|
|
/**
|
|
* Codigo de imagen
|
|
*/
|
|
private Integer codefile;
|
|
|
|
@Column(name="SUPERVISORID", nullable=true)
|
|
|
|
/**
|
|
* codigo fiscalizador
|
|
*/
|
|
private String supervisorid;
|
|
|
|
@Column(name="PERFORMANCE", nullable=true)
|
|
|
|
/**
|
|
* Indice de desempeño
|
|
*/
|
|
private Integer performance;
|
|
|
|
@Column(name="RECORDVERSION", nullable=true)
|
|
|
|
/**
|
|
* Optimistic locking del registro
|
|
*/
|
|
private Integer recordversion;
|
|
|
|
/**Contructor por defecto*/
|
|
public TcustSupervisor(){
|
|
}
|
|
/**Contructor de TcustSupervisor
|
|
@param pPk Clave Primaria del entity
|
|
*/
|
|
public TcustSupervisor(Integer 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 TcustSupervisor
|
|
*/
|
|
public static TcustSupervisor find(EntityManager pEntityManager,Object pKey) throws Exception{
|
|
TcustSupervisor obj = pEntityManager.find(TcustSupervisor.class,pKey);
|
|
return obj;
|
|
}
|
|
/**Entrega la Clave primaria de TcustSupervisor
|
|
@return El objeto que referencia a la Clave primaria de TcustSupervisor
|
|
*/
|
|
public Integer getPk(){
|
|
return pk;
|
|
}
|
|
/**Fija un nuevo valor a la Clave primaria de TcustSupervisor
|
|
@param pPk El objeto que referencia a la nueva Clave primaria de TcustSupervisor
|
|
*/
|
|
public void setPk(Integer pPk){
|
|
pk=pPk;
|
|
}
|
|
/**Obtiene el valor de codefile
|
|
@return valor de codefile*/
|
|
public Integer getCodefile(){
|
|
return codefile;
|
|
}
|
|
/**Fija el valor de codefile
|
|
@param pCodefile nuevo Valor de codefile*/
|
|
public void setCodefile(Integer pCodefile){
|
|
codefile=pCodefile;
|
|
}
|
|
|
|
/**Obtiene el valor de supervisorid
|
|
@return valor de supervisorid*/
|
|
public String getSupervisorid(){
|
|
return supervisorid;
|
|
}
|
|
/**Fija el valor de supervisorid
|
|
@param pSupervisorid nuevo Valor de supervisorid*/
|
|
public void setSupervisorid(String pSupervisorid){
|
|
supervisorid=pSupervisorid;
|
|
}
|
|
|
|
/**Obtiene el valor de performance
|
|
@return valor de performance*/
|
|
public Integer getPerformance(){
|
|
return performance;
|
|
}
|
|
/**Fija el valor de performance
|
|
@param pPerformance nuevo Valor de performance*/
|
|
public void setPerformance(Integer pPerformance){
|
|
performance=pPerformance;
|
|
}
|
|
|
|
/**Obtiene el valor de recordversion
|
|
@return valor de recordversion*/
|
|
public Integer getRecordversion(){
|
|
return recordversion;
|
|
}
|
|
/**Fija el valor de recordversion
|
|
@param pRecordversion nuevo Valor de recordversion*/
|
|
public void setRecordversion(Integer pRecordversion){
|
|
recordversion=pRecordversion;
|
|
}
|
|
|
|
public boolean equals(Object rhs){
|
|
if (rhs == null)return false;
|
|
if (! (rhs instanceof TcustSupervisor))return false;
|
|
TcustSupervisor that = (TcustSupervisor) rhs;
|
|
if (this.getPk() == null || that.getPk() == null)
|
|
return false;
|
|
return (this.getPk().equals(that.getPk()));
|
|
}
|
|
/**Implementacion del metodo hashCode de la la entidad TcustSupervisor
|
|
@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 TcustSupervisor
|
|
*/
|
|
public Object createInstance(){
|
|
TcustSupervisor instance=new TcustSupervisor();
|
|
return instance;
|
|
}
|
|
/**Clona la entidad TcustSupervisor
|
|
@see com.fp.dto.hb.HibernateBean#cloneMe()
|
|
*/
|
|
public Object cloneMe() throws CloneNotSupportedException{
|
|
TcustSupervisor p=(TcustSupervisor)this.clone();
|
|
return p;
|
|
}
|
|
}
|