org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

原因:再给数据库中放入新数据的时候加了id,然而有了id,系统默认为修改方法就回去在库中查找,所以出错。

解决方法:将生成的id去掉。

20.org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1的更多相关文章

  1. org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

    org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actua ...

  2. 关于Hibernate级联更新插入信息时提示主键不为空的问题“org.hibernate.StaleStateException: Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1 ”

    org.hibernate.StaleStateException: Batch update returned unexpected row count from update: 0 actual ...

  3. Batch update returned unexpected row count from update [0] 异常处理

    在one-to-many时遇到此异常,本以为是配置出错.在使用s标签开启debug模式,并在struts2主配置文件中添加异常映射,再次提交表单后得到以下异常详情. org.springframewo ...

  4. Batch update returned unexpected row count from update [0];

    Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; nested ...

  5. 关于Error during managed flush [Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1]错误

    控制台报错: 08:07:09.293 [http-bio-8080-exec-2] ERROR org.hibernate.internal.SessionImpl - HHH000346: Err ...

  6. Nhibernate Batch update returned unexpected row count from update; actual row count: 0 解决方案

    以前在session.Update(object).没发现啥问题,最近update的时候,老是报错:Nhibernate Batch update returned unexpected row co ...

  7. hibernate 解决 org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

    这是因为没有设置要更新的主键导致的,只要设置了要更新的主键就能更新成功(没有主键当然不能更新)

  8. Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1

    在操作hibernate数据库时,调用saveOrUpdate方法进行更新保存对象时, (1)ID为null时执行SAVE,但是前端jsp通过<input type="hidden&q ...

  9. 异常:Batch update returned unexpected row count from update [0]; actual row count: 0;

    使用了hibernate的主键生成策略,而在程序中又主动去设置了主键值.<class name="ProductRegion" table="PRODUCT_REG ...

随机推荐

  1. HTML8表单验证

    表单验证: 一.非空验证: 1.内容是不是空的. 判断值的长度是不是0.length属性.压缩空格的函数.   2.内容是不是改变了.   二.对比验证: 1.验证两个控件值的关系(相同,大小)   ...

  2. HTML1网页三部份内容

    网页三部份内容:HTML CSS Javascript 路径:一般做网页的时候用的相对路径. images/aaa.jpg 网页同一个目录中找images文件夹,再在images里面找aaa.jpg ...

  3. 编写jquery插件

    一.类级别($.extend) 类级别你可以理解为拓展jquery类,最明显的例子是$.ajax(...),相当于静态方法. 开发扩展其方法时使用$.extend方法,即jQuery.extend(o ...

  4. skynet配置文件

    启动skynet需要一个配置文件 我们看下examples/config root = "./"         表示根目录是skynet启动时的目录thread = 8     ...

  5. [问题解决] 启动mongod 时,出现addr already in use错误

    错误: 启动mongod root@wangyuyu-Vostro-:/usr/bin# ./mongod 错误提示: Sat Aug :: [initandlisten] ERROR: listen ...

  6. Linux学习之十一、环境变量的功能

    环境变量的功能 可以利用两个命令来查阅,分别是 env 与 export 呢! 范例一:列出目前的 shell 环境下的所有环境变量与其内容. [root@www ~]# env SHELL 告知我们 ...

  7. document.body.scrollTop与document.documentElement.scrollTop兼容

    这两天在写一个JS的网页右键菜单,在实现菜单定位的时候发现了这个问题:chrome居然不认识document.documentElement.scrollTop! 看前辈们的文章,纷纷表示如果有文档声 ...

  8. fs.rename可以重新写入文件

    fs.rename可以重新写入文件 用法 fs.rename(旧path,新path,callback)可以重新写入文件 引用地址 http://www.jb51.net/article/58548. ...

  9. php使用NuSoap调用java/C# webservice乱码问题

    今天调用了一个 NuSoap 的接口程序,一切流程操作都很正常,就是最后接收返回值的时候出现了乱码问题(我这边是做一个越南项目固然返回越南语,不过认为中文应该同样实用,需要的人可以尝试下)   许多使 ...

  10. HealthKit框架参考(转)

    来自:http://www.cocoachina.com/ios/20140915/9624.html 本文由CocoaChina翻译组成员 唧唧歪歪(微博) 翻译自苹果官方文档:The Health ...