我建了二张表是一对多关系,SQL语句执行了,SQL语包执行情况:Hibernate: select newstype_.tid, newstype_.name as name1_, newstype_.res as res1_ from newstype newstype_ where newstype_.tid=?
Hibernate: insert into newstype (name, res, tid) values (?, ?, ?)
Hibernate: update newspress set tid=?, title=?, content=?, author=?, presstime=?, res=? where pid=?
但是数据没有保存成功,报以下错误:
Exception in thread "main" org.hibernate.StaleStateException: Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1
如何解决

解决方案 »

  1.   

    此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
    楼主【z1018588】截止到2008-06-26 17:51:52的历史汇总数据(不包括此帖):
    发帖数:0                  发帖分:0                  
    结贴数:0                  结贴分:0                  
    未结数:0                  未结分:0                  
    结贴率:-------------------结分率:-------------------
    如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html
      

  2.   

    Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1
    这个意思是  批量更新 返回了不可预料的行数。   是否有 设置 联级保存 .
      

  3.   

    如果是saveorupdate的话,你给id一个数据库中不存在的值,会出这个错误或者update的时候也是一样