package com.fp.persistence.pgeneral.batch; import java.sql.Timestamp; import javax.persistence.Column; import java.io.Serializable; import com.fp.dto.hb.HibernateId; import java.lang.reflect.Field; import javax.persistence.Embeddable; import javax.persistence.Transient; /**Clase que hace referencia a la Clave Primaria de TGENEBATCHLOGPREVIOUSPROCESS*/ @Embeddable public class TgeneBatchLogPreviousProcessKey extends com.fp.dto.AbstractDataTransport implements Serializable,Cloneable,HibernateId{ /** * HashCode asociado con la Instancia */ @Transient private int hashValue = 0; /** * Version de la Clase */ private static final long serialVersionUID = 1L; @Column(name="PROCESSDATE", nullable=false,updatable=false) /** * Fecha contable de ejecución del batch */ private Timestamp processdate; @Column(name="JOURNALID", nullable=false,updatable=false) /** * Journalid de la ejecución del batch */ private String journalid; @Column(name="ACTIONCODE", nullable=false,updatable=false) /** * Código de accion */ private String actioncode; @Column(name="MODULECODE", nullable=false,updatable=false) /** * Codigo de modulo */ private String modulecode; /**Contructor por defecto*/ public TgeneBatchLogPreviousProcessKey(){} /**Contructor de TgeneBatchLogPreviousProcessKey @param pProcessdate Fecha contable de ejecución del batch @param pJournalid Journalid de la ejecución del batch @param pActioncode Código de accion @param pModulecode Codigo de modulo */ public TgeneBatchLogPreviousProcessKey(Timestamp pProcessdate,String pJournalid,String pActioncode,String pModulecode){ processdate=pProcessdate; journalid=pJournalid; actioncode=pActioncode; modulecode=pModulecode; } /**Obtiene el valor de processdate @return valor de processdate*/ public Timestamp getProcessdate(){ return processdate; } /**Fija el valor de processdate @param pProcessdate nuevo Valor de processdate*/ public void setProcessdate(Timestamp pProcessdate){ processdate=pProcessdate; } /**Obtiene el valor de journalid @return valor de journalid*/ public String getJournalid(){ return journalid; } /**Fija el valor de journalid @param pJournalid nuevo Valor de journalid*/ public void setJournalid(String pJournalid){ journalid=pJournalid; } /**Obtiene el valor de actioncode @return valor de actioncode*/ public String getActioncode(){ return actioncode; } /**Fija el valor de actioncode @param pActioncode nuevo Valor de actioncode*/ public void setActioncode(String pActioncode){ actioncode=pActioncode; } /**Obtiene el valor de modulecode @return valor de modulecode*/ public String getModulecode(){ return modulecode; } /**Fija el valor de modulecode @param pModulecode nuevo Valor de modulecode*/ public void setModulecode(String pModulecode){ modulecode=pModulecode; } /**Implementacion de la comparacion de TgeneBatchLogPreviousProcessKey @param o Objeto de comparacion */ public boolean equals(Object o){ if (o == null)return false; if (! (o instanceof TgeneBatchLogPreviousProcessKey))return false; TgeneBatchLogPreviousProcessKey that = (TgeneBatchLogPreviousProcessKey) o; if (this.getProcessdate() == null || that.getProcessdate() == null){ return false; } if (! this.getProcessdate().equals(that.getProcessdate())){ return false; } if (this.getJournalid() == null || that.getJournalid() == null){ return false; } if (! this.getJournalid().equals(that.getJournalid())){ return false; } if (this.getActioncode() == null || that.getActioncode() == null){ return false; } if (! this.getActioncode().equals(that.getActioncode())){ return false; } if (this.getModulecode() == null || that.getModulecode() == null){ return false; } if (! this.getModulecode().equals(that.getModulecode())){ return false; } return true; } /**Implementacion del metodo hashCode bajo el patron de Bloch @return hashCode de la instancia TgeneBatchLogPreviousProcessKey */ public int hashCode(){ if (this.hashValue == 0){ int result = 17; result = result * 37 + (this.getProcessdate() == null ? 0 : this.getProcessdate().hashCode()); result = result * 37 + (this.getJournalid() == null ? 0 : this.getJournalid().hashCode()); result = result * 37 + (this.getActioncode() == null ? 0 : this.getActioncode().hashCode()); result = result * 37 + (this.getModulecode() == null ? 0 : this.getModulecode().hashCode()); this.hashValue = result; } return this.hashValue; } public Object cloneMe() throws CloneNotSupportedException { return this.clone(); } /**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+="pk."+name+"="+f.get(this)+";"; }catch(Exception e){ continue; } } if(data.compareTo("")==0){ data=super.toString(); } return data; } }