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. 在.NET中使用iTextSharp创建/读取PDF报告: Part I [翻译]

    原文地址:Create/Read Advance PDF Report using iTextSharp in C# .NET: Part I    By Debopam Pal, 27 Nov 20 ...

  2. C#5 复习总结循环 迭代和穷举

    一.章节复习: 循环.反复执行某段语句一种语法形式. 1.基本语法: for( 初始条件 ; 循环条件 ; 状态的改变 ) { 循环体 } 循环的四要素. 循环的执行过程.初始条件--循环条件--循环 ...

  3. HDU1789(Doing Homework again)题解

    HDU1789(Doing Homework again)题解 以防万一,题目原文和链接均附在文末.那么先是题目分析: [一句话题意] 给定任务分数和其截止日期,每日可完成一任务,输出当罚分尽可能小时 ...

  4. python基础教程第2章——列表与元组笔记

    1.序列是Python中最基本的数据结构.序列中的每个元素被分配一个序列号——元素的位置,也称索引,第1个索引是0,第2为1,以此类推.序列中的最后1个元素为-1,倒数第2个位-2. python中有 ...

  5. 初学swift笔记-数组、字典、元组(三)

    数组的使用.字典的使用.元组的使用 import Foundation //1.定义数组 //集合数据 数组.字典 ,,,]//常用定义 ,,,]//常用定义 ,,,]//范型定义 ,,,] arr_ ...

  6. C语言基础03

    1.随机数 :一个范围内随机数字的返回值. 格式为: arc4random() % ( num大值 -num小值 + 1 ) + num小值. int n,i= 0;           //控制随机 ...

  7. 杭电oj 2095 & 异或^符号在C/C++中的使用

    异或^符号,在平时的学习时可能遇到的不多,不过有时使用得当可以发挥意想不到的结果. 值得注意的是,异或运算是建立在二进制基础上的,所有运算过程都是按位异或(即相同为0,不同为1,也称模二加),得到最终 ...

  8. Android系统移植与调试之------->如何修改Android设备的开机第二阶段Logo

    1.修改位置:/home/pyou/mx0831-0525/device/other/TBG1073目录 2.将robot.1024x600.png替换为自己想设置的图片命名必须一致,目录下还有其他不 ...

  9. Struts2 四、Struts2 处理流程

    1. 一个请求在Struts2框架中的处理步骤: a) 客户端初始化一个指向Servlet容器的请求: b) 根据Web.xml配置,请求首先经过ActionContextCleanUp过滤器,其为可 ...

  10. 复习day12-23

    获取请求中的内容: request.getParameter(); get方式因为在地址栏所以需要转码: String name = new String(req.getparameter().get ...