20.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 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的更多相关文章
- 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 ...
- 关于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 ...
- Batch update returned unexpected row count from update [0] 异常处理
在one-to-many时遇到此异常,本以为是配置出错.在使用s标签开启debug模式,并在struts2主配置文件中添加异常映射,再次提交表单后得到以下异常详情. org.springframewo ...
- 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 ...
- 关于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 ...
- Nhibernate Batch update returned unexpected row count from update; actual row count: 0 解决方案
以前在session.Update(object).没发现啥问题,最近update的时候,老是报错:Nhibernate Batch update returned unexpected row co ...
- hibernate 解决 org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
这是因为没有设置要更新的主键导致的,只要设置了要更新的主键就能更新成功(没有主键当然不能更新)
- 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 ...
- 异常:Batch update returned unexpected row count from update [0]; actual row count: 0;
使用了hibernate的主键生成策略,而在程序中又主动去设置了主键值.<class name="ProductRegion" table="PRODUCT_REG ...
随机推荐
- C#1 输入输出 常量变量
C# 输入输出 常量变量 //输出 Console.WriteLine("这是一行文字"); 自动回车的. Console.Write("Hello world&qu ...
- Vim 扩展工具 vim-ide (转)
通过简单的配置文件将 vim 打造成专业 ide,支持 mac linux cygwin.看过数篇 vim 配置文件,必要时去定制vim 的插件,将 vim 的 ide 用户体验尽量做到极致. 使用范 ...
- Hibernate的Criteria用法
在hibernate的Session里面使用createCriteria可以创建一个Criteria实例帮助我们进行条件查询,不用自己串hql语句,很方便. 用法很简单,首先传Class实例创建Cri ...
- usb驱动开发篇简易介绍
我这里重点的介绍如何写驱动程序,对于一些应用程序我就不做介绍了,因为我对于那些高层的东西写得很少.倘若再讲,有班门弄斧之嫌,呵呵! 作为WIN98和WIN2K推荐的一项新技术来说,USB的驱动程序和以 ...
- LPC同STM32的比较
Cortex-M3是新兴起来的一种ARM7的核,而ARM7TDMI是一种传统的经典的ARM内核.我们就抛开这一切,来比较一下两则的异同. 我们就在以下平台上比较吧: STMicoelectronics ...
- Delphi中的消息截获(六种方法:Hook,SubClass,Override WndProc,Message Handler,RTTI,Form1.WindowProc:=@myfun)good
Windows是一个基于消息驱动的系统,因此,在很多时候,我们需要截获一些消息然后自己进行处理.而VCL系统又有一些特定的消息.下面对我所了解的delphi环境中截获消息进行一些总结. 就个 ...
- Delphi编写的Android程序获取Root权限实现(2015.4.15更新,支持Android 4.4)
借助谷歌,并经过本大侠施展坑.蒙.拐.骗.偷五大绝技,终于成功实现在Delphi下获取Root权限并将其扩展为一个完整功能更加完整的TQAndroidShell记录,在华为荣耀2(Android 4. ...
- 第一章 andriod studio 安装与环境搭建
原文 http://blog.csdn.net/zhanghefu/article/details/9286123 第一章 andriod studio 安装与环境搭建 一.Android Stu ...
- perl /m修饰符使用说明
高级用法: 多行匹配: grok正则和普通正则一样, 默认是不支持匹配回车换行的. perl的/m选项 The /m modifier allows ^ and $ to match immediat ...
- 实现在ios文件读写
文件都是用来读写数据的,可是哪里都会有潜规则,ios里面读写数据的潜规则你知不知道,你知道不知道!!! 你有没有觉得NSUserDefaults和NSBundle,plist这些玩意阴魂不散,有时候搞 ...