could not fetch initial value for increment generator
来源:互联网 发布:电影票app推荐软件 编辑:程序博客网 时间:2024/06/06 04:29
公告:
程序员生活秀,挑你最爱,领取礼包![意见反馈][官方博客] could not fetch initial value for increment generator 收藏
在有外键关系数据插入的时候出现 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类型。
我个人认为,因为数据库表之间使用了外键关系,得需要底层数据库来维护用户自定义完整性。。。。。
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/zhqingyun163/archive/2010/01/08/5156165.aspx
- 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
- 描述数据库启动阶段
- Aop简单应用实例,注解模式
- 常用sql
- 一些常用的正则表达式
- 做一个努力的人
- could not fetch initial value for increment generator
- 7000个源码批量下载
- MYSQL数据库导入UTF8编码的SQL文件出现乱码如何解决
- 一个解除TCP连接的TIME_WAIT状态限制的简便方法
- 经典算法(4)- 用欧几里得算法实现扩展的最大公约数(Extended GCD)
- PL/SQL Developer8 注册码
- linux tr 命令详解
- java环境变量设置
- 7000个源码批量下载