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. spark JavaDirectKafkaWordCount 例子分析

    spark  JavaDirectKafkaWordCount 例子分析: 1. KafkaUtils.createDirectStream( jssc, String.class, String.c ...

  2. Server2008系统 FTP下载“当前的安全设置不允许”的解决方法

    IE -> Internet选项 -> 安全 -> Internte -> 自定义级别 设置 -> 下载 -> 文件下载 -> 启动

  3. Android Studio 实时显示布局文件Preview窗口

    Android Studio的功能包含preview窗口, 可以查看布局(layout)的样式; 位置:app->src->main->res(资源)->layout(布局), ...

  4. sed高级命令

    所谓高级,主要是指这里将要提到的命令都能改变sed执行或者控制的流程顺序(sed通常都是一行被读入模式空间,并用脚本中的sed命令一个接一个的应用于那一行). 高级sed命令分成3个组: 1)处理多行 ...

  5. RSA—非对称加密算法

    RSA:非对称加密算法加解密原理如下:已知:p,q,n,e,d,m,c其中:p与q互为大质数,n=p*q 公钥Pk(n,e):加密使用,是公开的 私钥Sk(n,d):解密使用,不公开 c:明文 m:密 ...

  6. leetcode算法刷题(三)

    今天在刷了几道简单的动态规划后,又看了看string方面的题 第五题 Longest Palindromic Substring 题目的意思:求一个字符串的最长回文子串 分析:开始,我的想法是,现在字 ...

  7. winform 拖动无边框窗体(调用Windows API)

    第一步:将窗体的FormBoderStyle属性设置为None: 第二步:添加一个新类:Win32.cs 代码如下: public class Win32 { [DllImport("use ...

  8. Spring摘记

    spring工作机制及为什么要用? 1.spring mvc请所有的请求都提交给DispatcherServlet,它会委托应用系统的其他模块负责负责对请求进行真正的处理工作.2.Dispatcher ...

  9. 在ubuntu10.0.4下更新git

    今天想到要在ubuntu10.0.4下下载android的源码学习一下.源码下载用到了git.以前安装过git以为应该没什么问题的,没想到报了 “fatal: git 1.7.2 or later r ...

  10. 习题3.4 & 3.5: 求两链表的交集和并集

    #include<stdio.h> #include<stdlib.h> struct Node; typedef struct Node *PtrToNode; typede ...