posted 11 years ago
Hi all,
I have GenericHibernateDao, and I'm working with differents methods, save, listALL, and it's work fine, but in the case of the load method:
@SuppressWarnings("unchecked")
public T load(ID id) {
try{
session=this.getHibernateTemplate();
session.beginTransaction();
T returnValue = (T) session.load(this.domainClass, id);
session.clear();
return returnValue;
}catch (RuntimeException re) {
log.error("find list failed", re);
throw re;
}finally{
if(session != null){
try{
session.close();
} catch(HibernateException e){/*no hacemos nada*/};
}
}
}
Don't throw error, but don't return any object and the id is in the database.
Thanks for all!!