252 lines
6.6 KiB
Plaintext
Executable File
252 lines
6.6 KiB
Plaintext
Executable File
package com.fp.persistence.pgeneral.gene;
|
||
|
||
import javax.persistence.Entity;
|
||
import javax.persistence.Id;
|
||
import javax.persistence.Column;
|
||
import javax.persistence.EntityManager;
|
||
import javax.persistence.Query;
|
||
|
||
import java.io.Serializable;
|
||
import javax.persistence.Table;
|
||
|
||
import com.fp.dto.hb.Cache;
|
||
import com.fp.dto.hb.HibernateBean;
|
||
import javax.persistence.Version;
|
||
import java.lang.reflect.Field;
|
||
import java.util.List;
|
||
|
||
import javax.persistence.Transient;
|
||
|
||
/** Clase que implementa la entidad de Hibernate que hace referencia a la tabla TGENEWILDCARD */
|
||
@Entity(name = "TgeneWildcard")
|
||
@Table(name = "TGENEWILDCARD")
|
||
public class TgeneWildcard extends com.fp.dto.AbstractDataTransport implements Serializable, HibernateBean, Cloneable, Cache {
|
||
/**
|
||
* 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 TgeneWildcard
|
||
*/
|
||
@Id
|
||
@Column(name = "WILDCARD", nullable = false, updatable = false)
|
||
private String pk;
|
||
@Version
|
||
@Column(name = "RECORDVERSION", nullable = true)
|
||
/**
|
||
* Optimistic locking del registro
|
||
*/
|
||
private Integer recordversion;
|
||
|
||
@Column(name = "PROCESSCODE", nullable = true)
|
||
/**
|
||
* null
|
||
*/
|
||
private String processcode;
|
||
|
||
@Column(name = "CATALOGTYPEPROCESS", nullable = true)
|
||
/**
|
||
* Codigo de catalogo GEN proceso general consulta, mantenimiento, TRA a nivel de transaccion finacniera, ITEM a niveld e rubro de una trnsaccion financiera, BATH comandos de fin de dia
|
||
*/
|
||
private String catalogtypeprocess;
|
||
|
||
@Column(name = "CATALOGCODETYPEPROCESS", nullable = true)
|
||
/**
|
||
* Codigo de tabla de catalogo del proceso de negocio de la aplicacion
|
||
*/
|
||
private String catalogcodetypeprocess;
|
||
|
||
/** Contructor por defecto */
|
||
public TgeneWildcard() {
|
||
}
|
||
/**
|
||
* Contructor de TgeneWildcard
|
||
*
|
||
* @param pPk Clave Primaria del entity
|
||
*/
|
||
public TgeneWildcard(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 TgeneWildcard
|
||
*/
|
||
public static TgeneWildcard find(EntityManager pEntityManager, Object pKey) throws Exception {
|
||
TgeneWildcard obj = pEntityManager.find(TgeneWildcard.class, pKey);
|
||
return obj;
|
||
}
|
||
/**
|
||
* Entrega la Clave primaria de TgeneWildcard
|
||
*
|
||
* @return El objeto que referencia a la Clave primaria de TgeneWildcard
|
||
*/
|
||
public String getPk() {
|
||
return pk;
|
||
}
|
||
/**
|
||
* Fija un nuevo valor a la Clave primaria de TgeneWildcard
|
||
*
|
||
* @param pPk El objeto que referencia a la nueva Clave primaria de TgeneWildcard
|
||
*/
|
||
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 processcode
|
||
*
|
||
* @return valor de processcode
|
||
*/
|
||
public String getProcesscode() {
|
||
return processcode;
|
||
}
|
||
/**
|
||
* Fija el valor de processcode
|
||
*
|
||
* @param pProcesscode nuevo Valor de processcode
|
||
*/
|
||
public void setProcesscode(String pProcesscode) {
|
||
processcode = pProcesscode;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de catalogtypeprocess
|
||
*
|
||
* @return valor de catalogtypeprocess
|
||
*/
|
||
public String getCatalogtypeprocess() {
|
||
return catalogtypeprocess;
|
||
}
|
||
/**
|
||
* Fija el valor de catalogtypeprocess
|
||
*
|
||
* @param pCatalogtypeprocess nuevo Valor de catalogtypeprocess
|
||
*/
|
||
public void setCatalogtypeprocess(String pCatalogtypeprocess) {
|
||
catalogtypeprocess = pCatalogtypeprocess;
|
||
}
|
||
|
||
/**
|
||
* Obtiene el valor de catalogcodetypeprocess
|
||
*
|
||
* @return valor de catalogcodetypeprocess
|
||
*/
|
||
public String getCatalogcodetypeprocess() {
|
||
return catalogcodetypeprocess;
|
||
}
|
||
/**
|
||
* Fija el valor de catalogcodetypeprocess
|
||
*
|
||
* @param pCatalogcodetypeprocess nuevo Valor de catalogcodetypeprocess
|
||
*/
|
||
public void setCatalogcodetypeprocess(String pCatalogcodetypeprocess) {
|
||
catalogcodetypeprocess = pCatalogcodetypeprocess;
|
||
}
|
||
|
||
public boolean equals(Object rhs) {
|
||
if (rhs == null)
|
||
return false;
|
||
if (!(rhs instanceof TgeneWildcard))
|
||
return false;
|
||
TgeneWildcard that = (TgeneWildcard) 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 TgeneWildcard
|
||
*
|
||
* @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 TgeneWildcard */
|
||
public Object createInstance() {
|
||
TgeneWildcard instance = new TgeneWildcard();
|
||
return instance;
|
||
}
|
||
/**
|
||
* Clona la entidad TgeneWildcard
|
||
*
|
||
* @see com.fp.dto.hb.HibernateBean#cloneMe()
|
||
*/
|
||
public Object cloneMe() throws CloneNotSupportedException {
|
||
TgeneWildcard p = (TgeneWildcard) this.clone();
|
||
return p;
|
||
}
|
||
|
||
//Metodos manuales.
|
||
|
||
private static String HQL = "from TgeneWildcard " ;
|
||
|
||
/**
|
||
* Metodo que entrega una lista de clases que resuelven los comodines contables.
|
||
* @param pEntityManager referencia a la session de la base de datos.
|
||
* @return List<TgeneWildcard>
|
||
* @throws Exception
|
||
*/
|
||
@SuppressWarnings("unchecked")
|
||
public static List<TgeneWildcard> findAll(EntityManager pEntityManager) throws Exception {
|
||
Query qry = pEntityManager.createQuery(HQL);
|
||
List<TgeneWildcard> ldata = null;
|
||
ldata = qry.getResultList();
|
||
return ldata;
|
||
}
|
||
}
|