【发布时间】:2018-09-23 14:48:24
【问题描述】:
我有一个使用 spring data / jpa 的 SpringBoot 2.0.1.RELEASE 应用程序
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
但是当我在 Amazon Aurora 数据库中进行更新时,我收到了这个错误:
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(strategy = GenerationType.AUTO)
private Long id;
我也想避免在数据库中获取 ID 的任何缺点。
【问题讨论】:
标签: java mysql spring spring-boot spring-data