表“DBNAME.hibernate\u序列”不存在

我有一个使用SpringData/jpa的SpringBoot 2.0.1.RELEASE应用程序

<依赖性>
<groupId>org.springframework.boot&lt/groupId>
<artifactId>弹簧启动启动器数据jpa&lt/artifactId>
&lt/依赖性>

但当我在Amazon Aurora DB中进行更新时,我得到了以下错误:

2018-04-13 09:20[pool-1-thread-1]错误o.h.id.enhanced.TableStructure.execute(148)-无法读取hi值
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)中不存在表’elbar.hibernate_sequence’

我想保存的实体中有这个

@Id
@GeneratedValue(策略=GenerationType.AUTO)
私人长id;

我还希望避免DB在获取ID时出现任何缺陷

使用generationGenerationType.AUTOhibernate将查找默认的hibernate\u序列表,因此将generation更改为IDENTITY,如下所示:

@Id
@GeneratedValue(策略=GenerationType.IDENTITY)
私人长id;

发表评论