Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
2012-05-27 15:34
477 查看
Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1网上都说是主键生成策略设置错了, 或者是在保存之前设置了id的值, 我的情况可能与上面有一点不同. 我发现原来是我在配置文件里面加了一个属性所致 (红色部分)
<id name="id" column="id" unsaved-value="-1">
<generator class="native"/>
</id>
其实这也就相当于在保存之前设置了默认id, 去掉这一个属性就OK了.
<id name="id" column="id" unsaved-value="-1">
<generator class="native"/>
</id>
其实这也就相当于在保存之前设置了默认id, 去掉这一个属性就OK了.
相关文章推荐
- 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:
- 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
- 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
- hibernate 报错: 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:
- 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