<i id='sGial'><tr id='sGial'><dt id='sGial'><q id='sGial'><span id='sGial'><b id='sGial'><form id='sGial'><ins id='sGial'></ins><ul id='sGial'></ul><sub id='sGial'></sub></form><legend id='sGial'></legend><bdo id='sGial'><pre id='sGial'><center id='sGial'></center></pre></bdo></b><th id='sGial'></th></span></q></dt></tr></i><div id='sGial'><tfoot id='sGial'></tfoot><dl id='sGial'><fieldset id='sGial'></fieldset></dl></div>

    <small id='sGial'></small><noframes id='sGial'>

      • <bdo id='sGial'></bdo><ul id='sGial'></ul>
    1. <tfoot id='sGial'></tfoot>
      <legend id='sGial'><style id='sGial'><dir id='sGial'><q id='sGial'></q></dir></style></legend>
    2. 表 'DBNAME.hibernate_sequence' 不存在

      时间:2024-08-24

        <tbody id='QG4S4'></tbody>

    3. <i id='QG4S4'><tr id='QG4S4'><dt id='QG4S4'><q id='QG4S4'><span id='QG4S4'><b id='QG4S4'><form id='QG4S4'><ins id='QG4S4'></ins><ul id='QG4S4'></ul><sub id='QG4S4'></sub></form><legend id='QG4S4'></legend><bdo id='QG4S4'><pre id='QG4S4'><center id='QG4S4'></center></pre></bdo></b><th id='QG4S4'></th></span></q></dt></tr></i><div id='QG4S4'><tfoot id='QG4S4'></tfoot><dl id='QG4S4'><fieldset id='QG4S4'></fieldset></dl></div>

      <small id='QG4S4'></small><noframes id='QG4S4'>

    4. <tfoot id='QG4S4'></tfoot>

              <bdo id='QG4S4'></bdo><ul id='QG4S4'></ul>
              <legend id='QG4S4'><style id='QG4S4'><dir id='QG4S4'><q id='QG4S4'></q></dir></style></legend>
                本文介绍了表 'DBNAME.hibernate_sequence' 不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

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

                I have a SpringBoot 2.0.1.RELEASE application using spring data / jpa

                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-data-jpa</artifactId>
                </dependency>
                

                但是当我在 Amazon Aurora 数据库中进行更新时,我收到了这个错误:

                But when I do an update in the Amazon Aurora DB, I got this error:

                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"

                2018-04-13 09:20 [pool-1-thread-1] ERROR o.h.id.enhanced.TableStructure.execute(148) - could not read a hi value com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'elbar.hibernate_sequence' doesn't exist at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                我在要保存的实体中有这个

                I have this in the entity I want to save

                @Id
                @GeneratedValue(strategy = GenerationType.AUTO)
                private Long id;
                

                我也想避免在数据库中获取 ID 的任何缺点.

                I would like to avoid also any drawback in the DB to fetch the ID .

                推荐答案

                随着生成 GenerationType.AUTO hibernate 会寻找默认的 hibernate_sequence 表,所以将生成更改为IDENTITY 如下:

                With the generation GenerationType.AUTO hibernate will look for the default hibernate_sequence table , so change generation to IDENTITY as below :

                 @Id
                 @GeneratedValue(strategy = GenerationType.IDENTITY)
                 private Long id;
                

                这篇关于表 'DBNAME.hibernate_sequence' 不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:Java MongoDB 对象版本控制 下一篇:如何检索给定域类的弹簧数据存储库实例?

                相关文章

                    <bdo id='Veebc'></bdo><ul id='Veebc'></ul>
                  <i id='Veebc'><tr id='Veebc'><dt id='Veebc'><q id='Veebc'><span id='Veebc'><b id='Veebc'><form id='Veebc'><ins id='Veebc'></ins><ul id='Veebc'></ul><sub id='Veebc'></sub></form><legend id='Veebc'></legend><bdo id='Veebc'><pre id='Veebc'><center id='Veebc'></center></pre></bdo></b><th id='Veebc'></th></span></q></dt></tr></i><div id='Veebc'><tfoot id='Veebc'></tfoot><dl id='Veebc'><fieldset id='Veebc'></fieldset></dl></div>

                  1. <legend id='Veebc'><style id='Veebc'><dir id='Veebc'><q id='Veebc'></q></dir></style></legend><tfoot id='Veebc'></tfoot>
                  2. <small id='Veebc'></small><noframes id='Veebc'>