340 lines
9.0 KiB
Plaintext
Executable File
340 lines
9.0 KiB
Plaintext
Executable File
package com.fp.persistence.pgeneral.msg;
|
||
|
||
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 javax.persistence.Version;
|
||
import java.lang.reflect.Field;
|
||
import javax.persistence.Transient;
|
||
|
||
/**Clase que implementa la entidad de Hibernate que hace referencia a la tabla TGENEMESSAGESTRUCTURE*/
|
||
@Entity(name="TgeneMessageStructure")
|
||
@Table(name="TGENEMESSAGESTRUCTURE")
|
||
public class TgeneMessageStructure 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 TgeneMessageStructure
|
||
*/
|
||
@Id
|
||
@Column(name="STRUCTURECODE" ,nullable=false, updatable=false)
|
||
private String pk;
|
||
@Version
|
||
@Column(name="RECORDVERSION", nullable=true)
|
||
|
||
/**
|
||
* Optimistic locking del registro
|
||
*/
|
||
private Integer recordversion;
|
||
|
||
@Column(name="DESCRIPTION", nullable=true)
|
||
|
||
/**
|
||
* Descripcion de la estructuura, propisito de la estructura
|
||
*/
|
||
private String description;
|
||
|
||
@Column(name="HAVEHEADER", nullable=true)
|
||
|
||
/**
|
||
* Y indica que el archivo tiene cabecera, N el archivo no tiene cabecera.
|
||
*/
|
||
private String haveheader;
|
||
|
||
@Column(name="HEADERLENGTH", nullable=true)
|
||
|
||
/**
|
||
* Longitud del header si tiene header, puede tener longitud o caracter de finalizacion.
|
||
*/
|
||
private Integer headerlength;
|
||
|
||
@Column(name="HEADERSEPARATOR", nullable=true)
|
||
|
||
/**
|
||
* Serador de campos del header.
|
||
*/
|
||
private String headerseparator;
|
||
|
||
@Column(name="ENDDATACHARACTER", nullable=true)
|
||
|
||
/**
|
||
* Caracter de finalizacion de un registro de datos.
|
||
*/
|
||
private String enddatacharacter;
|
||
|
||
@Column(name="RECORDLENGTH", nullable=true)
|
||
|
||
/**
|
||
* Longuitud de un registro de datos.
|
||
*/
|
||
private Integer recordlength;
|
||
|
||
@Column(name="RECORDSEPARATOR", nullable=true)
|
||
|
||
/**
|
||
* Separador de campos de datos.
|
||
*/
|
||
private String recordseparator;
|
||
|
||
@Column(name="FORMATDATE", nullable=true)
|
||
|
||
/**
|
||
* Formato de fecha que llega en los registros puede ser del header o de la data.
|
||
*/
|
||
private String formatdate;
|
||
|
||
@Column(name="FORMATTIME", nullable=true)
|
||
|
||
/**
|
||
* Formato de tiempo, horas minutos, segundos
|
||
*/
|
||
private String formattime;
|
||
|
||
@Column(name="HEADERCLASS", nullable=true)
|
||
|
||
/**
|
||
* Clase que se encarga de manipular el header, ejemplo almacenar los datos en una tabla.
|
||
*/
|
||
private String headerclass;
|
||
|
||
@Column(name="DETAILCLASS", nullable=true)
|
||
|
||
/**
|
||
* Clase que se encarga de manipular los registros de datos, ejemplo almacenar los datos en una tabla.
|
||
*/
|
||
private String detailclass;
|
||
|
||
/**Contructor por defecto*/
|
||
public TgeneMessageStructure(){
|
||
}
|
||
/**Contructor de TgeneMessageStructure
|
||
@param pPk Clave Primaria del entity
|
||
*/
|
||
public TgeneMessageStructure(String 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 TgeneMessageStructure
|
||
*/
|
||
public static TgeneMessageStructure find(EntityManager pEntityManager,Object pKey) throws Exception{
|
||
TgeneMessageStructure obj = pEntityManager.find(TgeneMessageStructure.class,pKey);
|
||
return obj;
|
||
}
|
||
/**Entrega la Clave primaria de TgeneMessageStructure
|
||
@return El objeto que referencia a la Clave primaria de TgeneMessageStructure
|
||
*/
|
||
public String getPk(){
|
||
return pk;
|
||
}
|
||
/**Fija un nuevo valor a la Clave primaria de TgeneMessageStructure
|
||
@param pPk El objeto que referencia a la nueva Clave primaria de TgeneMessageStructure
|
||
*/
|
||
public void setPk(String pPk){
|
||
pk=pPk;
|
||
}
|
||
/**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;
|
||
}
|
||
|
||
/**Obtiene el valor de description
|
||
@return valor de description*/
|
||
public String getDescription(){
|
||
return description;
|
||
}
|
||
/**Fija el valor de description
|
||
@param pDescription nuevo Valor de description*/
|
||
public void setDescription(String pDescription){
|
||
description=pDescription;
|
||
}
|
||
|
||
/**Obtiene el valor de haveheader
|
||
@return valor de haveheader*/
|
||
public String getHaveheader(){
|
||
return haveheader;
|
||
}
|
||
/**Fija el valor de haveheader
|
||
@param pHaveheader nuevo Valor de haveheader*/
|
||
public void setHaveheader(String pHaveheader){
|
||
haveheader=pHaveheader;
|
||
}
|
||
|
||
/**Obtiene el valor de headerlength
|
||
@return valor de headerlength*/
|
||
public Integer getHeaderlength(){
|
||
return headerlength;
|
||
}
|
||
/**Fija el valor de headerlength
|
||
@param pHeaderlength nuevo Valor de headerlength*/
|
||
public void setHeaderlength(Integer pHeaderlength){
|
||
headerlength=pHeaderlength;
|
||
}
|
||
|
||
/**Obtiene el valor de headerseparator
|
||
@return valor de headerseparator*/
|
||
public String getHeaderseparator(){
|
||
return headerseparator;
|
||
}
|
||
/**Fija el valor de headerseparator
|
||
@param pHeaderseparator nuevo Valor de headerseparator*/
|
||
public void setHeaderseparator(String pHeaderseparator){
|
||
headerseparator=pHeaderseparator;
|
||
}
|
||
|
||
/**Obtiene el valor de enddatacharacter
|
||
@return valor de enddatacharacter*/
|
||
public String getEnddatacharacter(){
|
||
return enddatacharacter;
|
||
}
|
||
/**Fija el valor de enddatacharacter
|
||
@param pEnddatacharacter nuevo Valor de enddatacharacter*/
|
||
public void setEnddatacharacter(String pEnddatacharacter){
|
||
enddatacharacter=pEnddatacharacter;
|
||
}
|
||
|
||
/**Obtiene el valor de recordlength
|
||
@return valor de recordlength*/
|
||
public Integer getRecordlength(){
|
||
return recordlength;
|
||
}
|
||
/**Fija el valor de recordlength
|
||
@param pRecordlength nuevo Valor de recordlength*/
|
||
public void setRecordlength(Integer pRecordlength){
|
||
recordlength=pRecordlength;
|
||
}
|
||
|
||
/**Obtiene el valor de recordseparator
|
||
@return valor de recordseparator*/
|
||
public String getRecordseparator(){
|
||
return recordseparator;
|
||
}
|
||
/**Fija el valor de recordseparator
|
||
@param pRecordseparator nuevo Valor de recordseparator*/
|
||
public void setRecordseparator(String pRecordseparator){
|
||
recordseparator=pRecordseparator;
|
||
}
|
||
|
||
/**Obtiene el valor de formatdate
|
||
@return valor de formatdate*/
|
||
public String getFormatdate(){
|
||
return formatdate;
|
||
}
|
||
/**Fija el valor de formatdate
|
||
@param pFormatdate nuevo Valor de formatdate*/
|
||
public void setFormatdate(String pFormatdate){
|
||
formatdate=pFormatdate;
|
||
}
|
||
|
||
/**Obtiene el valor de formattime
|
||
@return valor de formattime*/
|
||
public String getFormattime(){
|
||
return formattime;
|
||
}
|
||
/**Fija el valor de formattime
|
||
@param pFormattime nuevo Valor de formattime*/
|
||
public void setFormattime(String pFormattime){
|
||
formattime=pFormattime;
|
||
}
|
||
|
||
/**Obtiene el valor de headerclass
|
||
@return valor de headerclass*/
|
||
public String getHeaderclass(){
|
||
return headerclass;
|
||
}
|
||
/**Fija el valor de headerclass
|
||
@param pHeaderclass nuevo Valor de headerclass*/
|
||
public void setHeaderclass(String pHeaderclass){
|
||
headerclass=pHeaderclass;
|
||
}
|
||
|
||
/**Obtiene el valor de detailclass
|
||
@return valor de detailclass*/
|
||
public String getDetailclass(){
|
||
return detailclass;
|
||
}
|
||
/**Fija el valor de detailclass
|
||
@param pDetailclass nuevo Valor de detailclass*/
|
||
public void setDetailclass(String pDetailclass){
|
||
detailclass=pDetailclass;
|
||
}
|
||
|
||
public boolean equals(Object rhs){
|
||
if (rhs == null)return false;
|
||
if (! (rhs instanceof TgeneMessageStructure))return false;
|
||
TgeneMessageStructure that = (TgeneMessageStructure) 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 TgeneMessageStructure
|
||
@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;
|
||
}
|
||
/**Implementaci<63>n 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;
|
||
}
|
||
/**Implementaci<63>n de la creaci<63>n de un bean en blanco TgeneMessageStructure
|
||
*/
|
||
public Object createInstance(){
|
||
TgeneMessageStructure instance=new TgeneMessageStructure();
|
||
return instance;
|
||
}
|
||
/**Clona la entidad TgeneMessageStructure
|
||
@see com.fp.dto.hb.HibernateBean#cloneMe()
|
||
*/
|
||
public Object cloneMe() throws CloneNotSupportedException{
|
||
TgeneMessageStructure p=(TgeneMessageStructure)this.clone();
|
||
return p;
|
||
}
|
||
}
|