Home  >  Article  >  Database  >  框架-hibernate mysql generationtype.auto 没有自增

框架-hibernate mysql generationtype.auto 没有自增

WBOY
WBOYOriginal
2016-06-06 09:38:051662browse

mysql框架hibernate数据库

数据库是mysql,之前在实体类的主键上使用generationtype.auto主键策略 是可以自增的。
但是今天搭了一个新框架后不知道改了什么配置 文件,结果导致不在使用mysql自己的自增。
策略,而是单独生成了一张 hibernate_sequence 的表,里面只有一个next_val的字段。
但是却没有值,结果每次插入数据都提示错误"you need to populate the table: hibernate_sequence"。但是我把主键策略换成GenerationType.IDENTITY就是使用 的mysql自己
的 自增策略!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn