【解决方法】Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
2018-01-27 21:56
881 查看
使用hibernate的时候,抛了这个异常。先过图
然后发现是我在hbm.xml映射文件中设置了主键增长策略为自增长,结果我又设置了主键的值,所以报的这个错误。
解决方案:
程序中不设置主键的值。 或者把hbm.xml文件的主键增长策略改成其他的,不要是identity就行了。
相关文章推荐
- hibernate 报错: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 解决方法
- bug:Batch update returned unexpected row count from update: 0 actual row count: 2 expected: 1
- Hibernate - Batch update returned unexpected row count from update: 0 actual row count: 0 expected:
- 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
- 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: 3; expected: 1
- 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
- Batch update returned unexpected row count from update; actual row count: 0; expected: 1
- 错误: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
- 20.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
- 有关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解决方案
- 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
- Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
- Hibernate:Batch update returned unexpected row count from update [0]; actual row count: 0; expected: