简体   繁体   English

休眠更新导致测试失败并出现错误 - 未找到表“REVINFO”

[英]Hibernate update causes tests to fail with error - Table "REVINFO" not found

I updated my Spring boot version and that caused the hibernate version to update as well.我更新了我的 Spring Boot 版本,这也导致了休眠版本的更新。 These are the versions:这些是版本:

Spring boot - 2.7.0
Hibernate-core - 5.6.9
Hibernate-envers - 5.3.20.Final

It was updated from Spring boot version 2.3.9.RELEASE and Hibernate-core version 5.4.28 .它是从 Spring boot 版本2.3.9.RELEASE和 Hibernate-core 版本5.4.28的。

When I run the test suite, I see the error Table REVINFO not found :当我运行测试套件时,我看到错误Table REVINFO not found

Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "REVINFO" not found; SQL statement:
alter table insights.templateTable_aud add constraint FK9dw2kc3x0ti0c559slp64avtx foreign key (rev) references revinfo [42102-212]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) ~[h2-2.1.212.jar:2.1.212]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) ~[h2-2.1.212.jar:2.1.212]

I tried creating the revinfo table in my schema.sql but I still get the same error.我尝试在我的schema.sql中创建 revinfo 表,但我仍然得到同样的错误。 Any idea what might be wrong?知道可能出了什么问题吗?

It looks like the revinfo table is automatically generated;貌似revinfo表是自动生成的; it's not explicitly defined in the Spring project.它没有在 Spring 项目中明确定义。 The classes that have an @Audited tag above them have an audited table automatically generated for them.上面有@Audited标记的类会自动为它们生成一个审核表。

Check whether you need that audit log table to be there and if there is no need try removing the @Audited annotation and try restarting your server.检查您是否需要该审计日志表,如果不需要,请尝试删除@Audited注释并尝试重新启动服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM