public Users findById(String id){
log.debug("find by id");
try{
Users result=(Users)getHibernateTemplate().get(Users.class, id);
return result;
}catch (RuntimeException re) {
log.error("find by example failed", re);
throw re;
}
}
I get a null value. But I don’t know why. This function doesn’t throw an exception but just returns null.
In the meanwhile
List result=getHibernateTemplate().find("from Users as model where model.id="+id)
i can get data.
can you post Users.java . (Between I will name it User.java).
What is the type of Id property .Is it long?.
then use
Users result=(Users)getHibernateTemplate().get(Users.class, Long.parseLong(id));