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;
}
}
null値を取得します。でも理由はわかりません。この関数は例外をスローしませんが、を返すだけnull
です。その間
List result=getHibernateTemplate().find("from Users as model where model.id="+id)
データを取得できます。