maia_modificado/.svn/pristine/65/65d92d114c0111e802ba5bc15a2...

123 lines
3.6 KiB
Plaintext
Executable File
Raw Permalink Blame History

package com.fp.persistence.pgeneral.gene;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Column;
import javax.persistence.EntityManager;
import java.io.Serializable;
import javax.persistence.Table;
import com.fp.dto.hb.HibernateBean;
import java.lang.reflect.Field;
import javax.persistence.Transient;
import java.sql.Date;
/**Clase que implementa la entidad de Hibernate que hace referencia a la tabla TGENECASHCLOSE*/
@Entity(name="TgeneCashClose")
@Table(name="TGENECASHCLOSE")
public class TgeneCashClose 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 TgeneCashClose
*/
@EmbeddedId
private TgeneCashCloseKey pk;
/**Contructor por defecto*/
public TgeneCashClose(){
}
/**Contructor de TgeneCashClose
@param pPk Clave Primaria del entity
*/
public TgeneCashClose(TgeneCashCloseKey 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 TgeneCashClose
*/
public static TgeneCashClose find(EntityManager pEntityManager,TgeneCashCloseKey pKey) throws Exception{
TgeneCashClose obj = pEntityManager.find(TgeneCashClose.class,pKey);
return obj;
}
/**Entrega la Clave primaria de TgeneCashClose
@return El objeto que referencia a la Clave primaria de TgeneCashClose
*/
public TgeneCashCloseKey getPk(){
return pk;
}
/**Fija un nuevo valor a la Clave primaria de TgeneCashClose
@param pPk El objeto que referencia a la nueva Clave primaria de TgeneCashClose
*/
public void setPk(TgeneCashCloseKey pPk){
pk=pPk;
}
public boolean equals(Object rhs){
if (rhs == null)return false;
if (! (rhs instanceof TgeneCashClose))return false;
TgeneCashClose that = (TgeneCashClose) rhs;
if (this.getPk() == null || that.getPk() == null)
return false;
return (this.getPk().equals(that.getPk()));
}
/**Implementaci<63>n del metodo hashCode de la la entidad TgeneCashClose
@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;
}
/**Implementaci<63>n 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;
}
/**Implementaci<63>n de la creaci<63>n de un bean en blanco TgeneCashClose
*/
public Object createInstance(){
TgeneCashClose instance=new TgeneCashClose();
instance.setPk(new TgeneCashCloseKey());
return instance;
}
/**Clona la entidad TgeneCashClose
@see com.fp.dto.hb.HibernateBean#cloneMe()
*/
public Object cloneMe() throws CloneNotSupportedException{
TgeneCashClose p=(TgeneCashClose)this.clone();
p.setPk((TgeneCashCloseKey)this.pk.cloneMe());
return p;
}
}