日期:2014-05-19  浏览次数:20651 次

SSH之HibernateTemplate 使用
异常信息是
The given object has a null identifier: com.gf.po.User; nested exception is org.hibernate.TransientObjectException: The given object has a null identifier: com.gf.po.User




Action调用方法使用
public String modifyUser(T user) throws Exception{
dao.updateObject(user);
return  "success";
}


public <T> void updateObject(T clazz){
this.getHibernateTemplate().update(clazz);
}



已经成功注入   更新的时候为什么会有那样的异常信息,使用HibernateTemplate  update  传入的对象每个属性都不能为空?
------最佳解决方案--------------------
请,看我的文章吧~
传送门:http://blog.csdn.net/qq183293/article/details/7884127
分就我就好了~呵呵