Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring hibernate.globally_quoted_identifiers=内存数据库中H2的真正中断集成测试。找不到表_Spring_Hibernate_H2 - Fatal编程技术网

Spring hibernate.globally_quoted_identifiers=内存数据库中H2的真正中断集成测试。找不到表

Spring hibernate.globally_quoted_identifiers=内存数据库中H2的真正中断集成测试。找不到表,spring,hibernate,h2,Spring,Hibernate,H2,由于升级到MySQL版本8.0,我的一些表的名称现在是保留字。因此,我添加了属性hibernate.globally\u quoted\u identifiers=true。这解决了这个问题,但它破坏了我的集成测试,它使用H2作为内存中的DB。 我使用Hibernate来持久化JPA实体,并使用Spring的TestEntityManager来管理测试期间与数据库的交互。 我得到的错误是 2020-10-08 10:08:38 WARN [o.h.e.j.s.SqlExceptionHelpe

由于升级到MySQL版本8.0,我的一些表的名称现在是保留字。因此,我添加了属性
hibernate.globally\u quoted\u identifiers=true
。这解决了这个问题,但它破坏了我的集成测试,它使用H2作为内存中的DB。 我使用Hibernate来持久化JPA实体,并使用Spring的
TestEntityManager
来管理测试期间与数据库的交互。 我得到的错误是

2020-10-08 10:08:38  WARN [o.h.e.j.s.SqlExceptionHelper]: SQL Error: 42102, SQLState: 42S02
2020-10-08 10:08:38  ERROR [o.h.e.j.s.SqlExceptionHelper]: Table "CALCULATION" not found; 
SQL statement: insert into `calculation` (.....)
这是我的h2url:
jdbc:H2:mem:testdb;DB_CLOSE_DELAY=-1;DB_关闭_上的_退出=错误;锁定超时=10000;MVCC=真

我尝试添加
;数据库\u TO \u UPPER=false
到url

下面是我的JPA实体的一个片段

@Entity
@Table(name = "calculation")
public class Calculation extends BaseEntity<Long> implements Serializable
@实体
@表(name=“计算”)
公共类计算扩展BaseEntity实现可序列化

有什么想法吗???

解决了。这可能不适用于所有人,但我必须补充一点
hibernate.globally\u quoted\u identifiers\u skip\u column\u definitions=true
。 发布此邮件以防对其他人有所帮助