could not fetch initial value for increment generator
来源:互联网 发布:sql 表约束 编辑:程序博客网 时间:2024/06/08 15:45
在有外键关系数据插入的时候出现 could not fetch initial value for increment generator 异常
解决:查看.hbm.xml配置文件发现 id 的 <generator class="increment" />,修改为<generator class="identity" /> 运行OK!
为什么??? identity - increment
首先得区别这两个主键生成器的原理:
identity:由底层数据库生成标识符。identity是由数据库自己生成的,但这个主键必须设置为自增长,
前提条件是低层数据库支持自动 增长字段类型。
increment:由hibernate管理主键,自动以递增的方式生成标识符,每次增量为1。其在每次插入前取得一个当前最大的id+1
作为主键,该主键必须为Integer类型。
我个人认为,因为数据库表之间使用了外键关系,得需要底层数据库来维护用户自定义完整性。。。。。
- could not fetch initial value for increment generator
- could not fetch initial value for increment generator
- could not fetch initial value for increment generator
- hibernate 抛出could not fetch initial value for increment generator
- hibernate 的小问题 could not fetch initial value for increment generator
- org.hibernate.exception.SQLGrammarException: could not fetch initial value for increment generator
- could not fetch initial value for increment gener
- SSH整合过程中出现的问题:could not fetch initial value for increment generatorat..
- Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not fetch initial valu
- could not launch process: Could not determine version number: could not find symbol value for runtim
- Could not find value for key log4j.appender.WARN
- could not initial proxy - no session
- could not instantiate id generator
- Spring cloud config server Could not fetch remote for master remote: 解决
- pip Could not fetch URL的解决方案
- Could not decode attr value
- Maven: Could not get the value for parameter encoding for plugin execution default-resources Plugin
- CoreException: Could not get the value for parameter compilerId for plugin execution default-compile
- The using of import
- ascii unicode utf8 gkb之间的关系
- Evernote使用中遇到的问题
- 转载——如何把文件打包进NK
- tomcat "out of memory" error 的解决办法
- could not fetch initial value for increment generator
- 解除openSessionInViewFilter给我的迷惑了
- 可以进行FFT及其逆变换的函数!
- SQLITE入门-逐步讲解SQLITE命令行(四)
- SQL SERVER事务复制--工作原理测试
- Button 无边框样式
- SQLITE入门-逐步讲解SQLITE命令行(五)
- Java Mail send email
- 在做软件开发时用的FFT类,后来又改到DSP上了效果还不错