小编典典

Hibernate序列不存在

hibernate

我尝试在spring4.2版本的项目中将hibernate模式从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)

错误仍然存​​在。


阅读 368

收藏
2020-06-20

共1个答案

小编典典

您需要设置Hibernate5.x <property name="hibernate.id.new_generator_mappings">false</property>..参见并链接

对于较早版本的hibernate 4.x: <prop key="hibernate.id.new_generator_mappings">false</prop>

2020-06-20