maia_modificado/.svn/pristine/5c/5c2fa2589dda458cad69bc044b0...

303 lines
7.9 KiB
Plaintext
Executable File

package com.fp.persistence.pbpm.gene;
import javax.persistence.Entity;
import java.sql.Timestamp;
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;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
import javax.persistence.GeneratedValue;
/**Clase que implementa la entidad de Hibernate que hace referencia a la tabla TBPMNOTIFY*/
@Entity(name="TbpmNotify")
@Table(name="TBPMNOTIFY")
public class TbpmNotify 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 TbpmNotify
*/
@Id
@Column(name="NOTIFYCODE" ,nullable=false, updatable=false)
@GenericGenerator(name = "seq_id", strategy = "com.fp.general.keygen.SequenceKey", parameters = {
@Parameter(name = "name", value = "NOTIFYCODE"), @Parameter(name = "type", value = "java.lang.String"),
@Parameter(name = "fill", value = "0"), @Parameter(name = "length", value = "5") })
@GeneratedValue(generator = "seq_id")
private String pk;
@Column(name="PROCESSCODE", nullable=false)
/**
* Proceso en el que se encuentra el tramite para envio de notificacion
*/
private String processcode;
@Column(name="COMMENTS", nullable=false)
/**
* El texto de la notificación.
*/
private String comments;
@Column(name="NOTIFYTASK", nullable=false)
/**
* null
*/
private String notifytask;
@Column(name="RESOLUTION", nullable=true)
/**
* Nro de resolucion en caso de que se requiera
*/
private String resolution;
@Column(name="USERWHOREG", nullable=false)
/**
* Usuario que registro la notificacion
*/
private String userwhoreg;
@Column(name="REGISTERDATE", nullable=false)
/**
* Fecha de Registro
*/
private Timestamp registerdate;
@Column(name="NOTIFYTOCATALOG", nullable=true)
/**
* Codigo de catalogo 01 Natural, 02 Juridico
*/
private String notifytocatalog;
@Column(name="NOTIFYTOCATALOGCODE", nullable=true)
/**
* Codigo de tabla de catalogo 01 Codigo de tabla de tipos de persona
*/
private String notifytocatalogcode;
@Version
@Column(name="RECORDVERSION", nullable=true)
/**
* Manejo de optimistic locking
*/
private Integer recordversion;
/**Contructor por defecto*/
public TbpmNotify(){
}
/**Contructor de TbpmNotify
@param pPk Clave Primaria del entity
@param pProcesscode Proceso en el que se encuentra el tramite para envio de notificacion
@param pComments El texto de la notificación.
@param pNotifytask null
@param pUserwhoreg Usuario que registro la notificacion
@param pRegisterdate Fecha de Registro
*/
public TbpmNotify(String pPk,String pProcesscode,String pComments,String pNotifytask,String pUserwhoreg,Timestamp pRegisterdate){
this();
pk=pPk;
processcode=pProcesscode;
comments=pComments;
notifytask=pNotifytask;
userwhoreg=pUserwhoreg;
registerdate=pRegisterdate;
}
/**
* 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 TbpmNotify
*/
public static TbpmNotify find(EntityManager pEntityManager,Object pKey) throws Exception{
TbpmNotify obj = pEntityManager.find(TbpmNotify.class,pKey);
return obj;
}
/**Entrega la Clave primaria de TbpmNotify
@return El objeto que referencia a la Clave primaria de TbpmNotify
*/
public String getPk(){
return pk;
}
/**Fija un nuevo valor a la Clave primaria de TbpmNotify
@param pPk El objeto que referencia a la nueva Clave primaria de TbpmNotify
*/
public void setPk(String pPk){
pk=pPk;
}
/**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 comments
@return valor de comments*/
public String getComments(){
return comments;
}
/**Fija el valor de comments
@param pComments nuevo Valor de comments*/
public void setComments(String pComments){
comments=pComments;
}
/**Obtiene el valor de notifytask
@return valor de notifytask*/
public String getNotifytask(){
return notifytask;
}
/**Fija el valor de notifytask
@param pNotifytask nuevo Valor de notifytask*/
public void setNotifytask(String pNotifytask){
notifytask=pNotifytask;
}
/**Obtiene el valor de resolution
@return valor de resolution*/
public String getResolution(){
return resolution;
}
/**Fija el valor de resolution
@param pResolution nuevo Valor de resolution*/
public void setResolution(String pResolution){
resolution=pResolution;
}
/**Obtiene el valor de userwhoreg
@return valor de userwhoreg*/
public String getUserwhoreg(){
return userwhoreg;
}
/**Fija el valor de userwhoreg
@param pUserwhoreg nuevo Valor de userwhoreg*/
public void setUserwhoreg(String pUserwhoreg){
userwhoreg=pUserwhoreg;
}
/**Obtiene el valor de registerdate
@return valor de registerdate*/
public Timestamp getRegisterdate(){
return registerdate;
}
/**Fija el valor de registerdate
@param pRegisterdate nuevo Valor de registerdate*/
public void setRegisterdate(Timestamp pRegisterdate){
registerdate=pRegisterdate;
}
/**Obtiene el valor de notifytocatalog
@return valor de notifytocatalog*/
public String getNotifytocatalog(){
return notifytocatalog;
}
/**Fija el valor de notifytocatalog
@param pNotifytocatalog nuevo Valor de notifytocatalog*/
public void setNotifytocatalog(String pNotifytocatalog){
notifytocatalog=pNotifytocatalog;
}
/**Obtiene el valor de notifytocatalogcode
@return valor de notifytocatalogcode*/
public String getNotifytocatalogcode(){
return notifytocatalogcode;
}
/**Fija el valor de notifytocatalogcode
@param pNotifytocatalogcode nuevo Valor de notifytocatalogcode*/
public void setNotifytocatalogcode(String pNotifytocatalogcode){
notifytocatalogcode=pNotifytocatalogcode;
}
/**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 TbpmNotify))return false;
TbpmNotify that = (TbpmNotify) rhs;
if (this.getPk() == null || that.getPk() == null)
return false;
return (this.getPk().equals(that.getPk()));
}
/**Implementacion del metodo hashCode de la la entidad TbpmNotify
@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 TbpmNotify
*/
public Object createInstance(){
TbpmNotify instance=new TbpmNotify();
return instance;
}
/**Clona la entidad TbpmNotify
@see com.fp.dto.hb.HibernateBean#cloneMe()
*/
public Object cloneMe() throws CloneNotSupportedException{
TbpmNotify p=(TbpmNotify)this.clone();
return p;
}
}