maia_modificado/.svn/pristine/7f/7fd38c88f118c5681b877c77c76...

125 lines
3.4 KiB
Plaintext
Executable File

package com.fp.persistence.pgeneral.result;
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 TGENERESULTS*/
@Embeddable
public class TgeneResultsKey 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="RESULTCODE", nullable=false,updatable=false)
/**
* Codigo identificador asociado al mensaje o excepcion
*/
private String resultcode;
@Column(name="LANGUAGECODE", nullable=false,updatable=false)
/**
* Codigo de idioma
*/
private String languagecode;
/**Contructor por defecto*/
public TgeneResultsKey(){}
/**Contructor de TgeneResultsKey
@param pResultcode Codigo identificador asociado al mensaje o excepcion
@param pLanguagecode Codigo de idioma
*/
public TgeneResultsKey(String pResultcode,String pLanguagecode){
resultcode=pResultcode;
languagecode=pLanguagecode;
}
/**Obtiene el valor de resultcode
@return valor de resultcode*/
public String getResultcode(){
return resultcode;
}
/**Fija el valor de resultcode
@param pResultcode nuevo Valor de resultcode*/
public void setResultcode(String pResultcode){
resultcode=pResultcode;
}
/**Obtiene el valor de languagecode
@return valor de languagecode*/
public String getLanguagecode(){
return languagecode;
}
/**Fija el valor de languagecode
@param pLanguagecode nuevo Valor de languagecode*/
public void setLanguagecode(String pLanguagecode){
languagecode=pLanguagecode;
}
/**Implementacion de la comparacion de TgeneResultsKey
@param o Objeto de comparacion
*/
public boolean equals(Object o){
if (o == null)return false;
if (! (o instanceof TgeneResultsKey))return false;
TgeneResultsKey that = (TgeneResultsKey) o;
if (this.getResultcode() == null || that.getResultcode() == null){
return false;
}
if (! this.getResultcode().equals(that.getResultcode())){
return false;
}
if (this.getLanguagecode() == null || that.getLanguagecode() == null){
return false;
}
if (! this.getLanguagecode().equals(that.getLanguagecode())){
return false;
}
return true;
}
/**Implementacion del metodo hashCode bajo el patron de Bloch
@return hashCode de la instancia TgeneResultsKey
*/
public int hashCode(){
if (this.hashValue == 0){
int result = 17;
result = result * 37 + (this.getResultcode() == null ? 0 : this.getResultcode().hashCode());
result = result * 37 + (this.getLanguagecode() == null ? 0 : this.getLanguagecode().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;
}
}