读书人

SSH之HibernateTemplate 施用

发布时间: 2012-12-16 12:02:32 作者: rapoo

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
分就我就好了~呵呵

读书人网 >J2EE开发

热点推荐