本文介绍了Hibernate序列不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试着在我的项目中用hibernate 4.2
版本将hibernate从4升级到5。在升级之后,当我调用更新方法时,在堆栈跟踪中发现以下错误。
10:53:32,185 ERROR TableStructure:149 - 无法读取hi值
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:表'test.hibernate_sequence'不存在
我使用注解改变了自动增加的ID
@GeneratedValue (strategy = GenerationType.AUTO)
仍然存在错误。
< prop key =hibernate.id.new_generator_mappings> false< / prop> ..看到和。
I tried to upgrade hibernate from 4 to 5 in my project with spring 4.2
version. After this upgrade, I found the following error in my stack trace when I called a method for updating.
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
I changed the auto incremented Id with annotation
@GeneratedValue(strategy=GenerationType.AUTO)
still the error remains.
解决方案
You need to set <prop key="hibernate.id.new_generator_mappings">false</prop>
.. see link and link.
这篇关于Hibernate序列不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!