242 lines
6.2 KiB
Plaintext
Executable File
242 lines
6.2 KiB
Plaintext
Executable File
package com.fp.persistence.pbpm.gene;
|
|
|
|
import java.io.Serializable;
|
|
import java.lang.reflect.Field;
|
|
import java.sql.Timestamp;
|
|
|
|
import javax.persistence.Column;
|
|
import javax.persistence.Entity;
|
|
import javax.persistence.EntityManager;
|
|
import javax.persistence.GeneratedValue;
|
|
import javax.persistence.Id;
|
|
import javax.persistence.Table;
|
|
import javax.persistence.Transient;
|
|
|
|
import org.hibernate.annotations.GenericGenerator;
|
|
import org.hibernate.annotations.Parameter;
|
|
|
|
import com.fp.dto.hb.HibernateBean;
|
|
|
|
/**Clase que implementa la entidad de Hibernate que hace referencia a la tabla TBPMLOGMAIL*/
|
|
@Entity(name="TbpmLogMail")
|
|
@Table(name="TBPMLOGMAIL")
|
|
public class TbpmLogMail 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 TbpmLogMail
|
|
*/
|
|
@Id
|
|
@Column(name="CLOGMAIL" ,nullable=false, updatable=false)
|
|
@GenericGenerator(name = "seq_id", strategy = "com.fp.general.keygen.SequenceKey", parameters = {
|
|
@Parameter(name = "name", value = "CLOGMAIL"),//campo secuencial de la tabla
|
|
@Parameter(name = "type", value = "java.lang.Long"),// tipo de dato
|
|
@Parameter(name = "fill", value = "0"),
|
|
@Parameter(name = "length", value = "16")})
|
|
@GeneratedValue(generator = "seq_id")
|
|
private Long pk;
|
|
@Column(name="ESTADO", nullable=true)
|
|
|
|
/**
|
|
* Estado del envio del mail
|
|
*/
|
|
private String estado;
|
|
|
|
@Column(name="CORREO", nullable=true)
|
|
|
|
/**
|
|
* Mail del destinatario
|
|
*/
|
|
private String correo;
|
|
|
|
@Column(name="FECHAREGISTRO", nullable=true)
|
|
|
|
/**
|
|
* null
|
|
*/
|
|
private Timestamp fecharegistro;
|
|
|
|
@Column(name="ASUNTO", nullable=true)
|
|
|
|
/**
|
|
* Asunto del correo que se esta enviando
|
|
*/
|
|
private String asunto;
|
|
|
|
@Column(name="CONTENIDO", nullable=true)
|
|
|
|
/**
|
|
* Contenido del mensaje
|
|
*/
|
|
private String contenido;
|
|
|
|
@Column(name="DESCRIPCIONERROR", nullable=true)
|
|
|
|
/**
|
|
* Descripcion del error, que se produjo al tratar de enviar el mail
|
|
*/
|
|
private String descripcionerror;
|
|
|
|
/**Contructor por defecto*/
|
|
public TbpmLogMail(){
|
|
}
|
|
/**Contructor de TbpmLogMail
|
|
@param pPk Clave Primaria del entity
|
|
*/
|
|
public TbpmLogMail(Long 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 TbpmLogMail
|
|
*/
|
|
public static TbpmLogMail find(EntityManager pEntityManager,Object pKey) throws Exception{
|
|
TbpmLogMail obj = pEntityManager.find(TbpmLogMail.class,pKey);
|
|
return obj;
|
|
}
|
|
/**Entrega la Clave primaria de TbpmLogMail
|
|
@return El objeto que referencia a la Clave primaria de TbpmLogMail
|
|
*/
|
|
public Long getPk(){
|
|
return pk;
|
|
}
|
|
/**Fija un nuevo valor a la Clave primaria de TbpmLogMail
|
|
@param pPk El objeto que referencia a la nueva Clave primaria de TbpmLogMail
|
|
*/
|
|
public void setPk(Long pPk){
|
|
pk=pPk;
|
|
}
|
|
/**Obtiene el valor de estado
|
|
@return valor de estado*/
|
|
public String getEstado(){
|
|
return estado;
|
|
}
|
|
/**Fija el valor de estado
|
|
@param pEstado nuevo Valor de estado*/
|
|
public void setEstado(String pEstado){
|
|
estado=pEstado;
|
|
}
|
|
|
|
/**Obtiene el valor de correo
|
|
@return valor de correo*/
|
|
public String getCorreo(){
|
|
return correo;
|
|
}
|
|
/**Fija el valor de correo
|
|
@param pCorreo nuevo Valor de correo*/
|
|
public void setCorreo(String pCorreo){
|
|
correo=pCorreo;
|
|
}
|
|
|
|
/**Obtiene el valor de fecharegistro
|
|
@return valor de fecharegistro*/
|
|
public Timestamp getFecharegistro(){
|
|
return fecharegistro;
|
|
}
|
|
/**Fija el valor de fecharegistro
|
|
@param pFecharegistro nuevo Valor de fecharegistro*/
|
|
public void setFecharegistro(Timestamp pFecharegistro){
|
|
fecharegistro=pFecharegistro;
|
|
}
|
|
|
|
/**Obtiene el valor de asunto
|
|
@return valor de asunto*/
|
|
public String getAsunto(){
|
|
return asunto;
|
|
}
|
|
/**Fija el valor de asunto
|
|
@param pAsunto nuevo Valor de asunto*/
|
|
public void setAsunto(String pAsunto){
|
|
asunto=pAsunto;
|
|
}
|
|
|
|
/**Obtiene el valor de contenido
|
|
@return valor de contenido*/
|
|
public String getContenido(){
|
|
return contenido;
|
|
}
|
|
/**Fija el valor de contenido
|
|
@param pContenido nuevo Valor de contenido*/
|
|
public void setContenido(String pContenido){
|
|
contenido=pContenido;
|
|
}
|
|
|
|
/**Obtiene el valor de descripcionerror
|
|
@return valor de descripcionerror*/
|
|
public String getDescripcionerror(){
|
|
return descripcionerror;
|
|
}
|
|
/**Fija el valor de descripcionerror
|
|
@param pDescripcionerror nuevo Valor de descripcionerror*/
|
|
public void setDescripcionerror(String pDescripcionerror){
|
|
descripcionerror=pDescripcionerror;
|
|
}
|
|
|
|
public boolean equals(Object rhs){
|
|
if (rhs == null)return false;
|
|
if (! (rhs instanceof TbpmLogMail))return false;
|
|
TbpmLogMail that = (TbpmLogMail) rhs;
|
|
if (this.getPk() == null || that.getPk() == null)
|
|
return false;
|
|
return (this.getPk().equals(that.getPk()));
|
|
}
|
|
/**Implementacion del metodo hashCode de la la entidad TbpmLogMail
|
|
@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 TbpmLogMail
|
|
*/
|
|
public Object createInstance(){
|
|
TbpmLogMail instance=new TbpmLogMail();
|
|
return instance;
|
|
}
|
|
/**Clona la entidad TbpmLogMail
|
|
@see com.fp.dto.hb.HibernateBean#cloneMe()
|
|
*/
|
|
public Object cloneMe() throws CloneNotSupportedException{
|
|
TbpmLogMail p=(TbpmLogMail)this.clone();
|
|
return p;
|
|
}
|
|
}
|