我尝试在我的项目中使用 spring 4.2
版本将休眠从 4 升级到 5。升级后,我在调用更新方法时在堆栈跟踪中发现了以下错误。
10:53:32,185 ERROR TableStructure:149 - could not read a hi value
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'test.hibernate_sequence' doesn't exist
我用注释更改了自动递增的 ID
@GeneratedValue(strategy=GenerationType.AUTO)
错误仍然存在。
原文由 rParvathi 发布,翻译遵循 CC BY-SA 4.0 许可协议
您需要为 Hibernate5.x 设置
<property name="hibernate.id.new_generator_mappings">false</property>
.. 查看和 链接。对于旧版本的休眠 4.x:
<prop key="hibernate.id.new_generator_mappings">false</prop>