package com.fp.persistence.parmas.soli; 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 TARMCERTIFICADOARMAS*/ @Embeddable public class TarmCertificadoArmasKey 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="SESSIONID", nullable=false,updatable=false) /** * null */ private String sessionid; @Column(name="FECHAREPORTE", nullable=false,updatable=false) /** * null */ private Timestamp fechareporte; @Column(name="ORDEN", nullable=false,updatable=false) /** * null */ private Integer orden; /**Contructor por defecto*/ public TarmCertificadoArmasKey(){} /**Contructor de TarmCertificadoArmasKey @param pSessionid null @param pFechareporte null @param pOrden null */ public TarmCertificadoArmasKey(String pSessionid,Timestamp pFechareporte,Integer pOrden){ sessionid=pSessionid; fechareporte=pFechareporte; orden=pOrden; } /**Obtiene el valor de sessionid @return valor de sessionid*/ public String getSessionid(){ return sessionid; } /**Fija el valor de sessionid @param pSessionid nuevo Valor de sessionid*/ public void setSessionid(String pSessionid){ sessionid=pSessionid; } /**Obtiene el valor de fechareporte @return valor de fechareporte*/ public Timestamp getFechareporte(){ return fechareporte; } /**Fija el valor de fechareporte @param pFechareporte nuevo Valor de fechareporte*/ public void setFechareporte(Timestamp pFechareporte){ fechareporte=pFechareporte; } /**Obtiene el valor de orden @return valor de orden*/ public Integer getOrden(){ return orden; } /**Fija el valor de orden @param pOrden nuevo Valor de orden*/ public void setOrden(Integer pOrden){ orden=pOrden; } /**Implementacion de la comparacion de TarmCertificadoArmasKey @param o Objeto de comparacion */ public boolean equals(Object o){ if (o == null)return false; if (! (o instanceof TarmCertificadoArmasKey))return false; TarmCertificadoArmasKey that = (TarmCertificadoArmasKey) o; if (this.getSessionid() == null || that.getSessionid() == null){ return false; } if (! this.getSessionid().equals(that.getSessionid())){ return false; } if (this.getFechareporte() == null || that.getFechareporte() == null){ return false; } if (! this.getFechareporte().equals(that.getFechareporte())){ return false; } if (this.getOrden() == null || that.getOrden() == null){ return false; } if (! this.getOrden().equals(that.getOrden())){ return false; } return true; } /**Implementacion del metodo hashCode bajo el patron de Bloch @return hashCode de la instancia TarmCertificadoArmasKey */ public int hashCode(){ if (this.hashValue == 0){ int result = 17; result = result * 37 + (this.getSessionid() == null ? 0 : this.getSessionid().hashCode()); result = result * 37 + (this.getFechareporte() == null ? 0 : this.getFechareporte().hashCode()); result = result * 37 + (this.getOrden() == null ? 0 : this.getOrden().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; } }