Spring Hibernate Envers审核表列从jsonb更改为uuid

Spring Hibernate Envers审核表列从jsonb更改为uuid,spring,hibernate,hibernate-envers,Spring,Hibernate,Hibernate Envers,我在一个实体中有一个jsonb列,如示例代码中所示。没有@Audited注释,一切正常。添加审计注释将创建带有uuid而不是jsonb类型的列自定义字段的org_master_aud表,插入失败 @TypeDef(name = "jsonb", typeClass = JsonBinaryType.class) @Audited public class OrgMaster { @Type(type = "jsonb") @Column(columnDefinition = "j

我在一个实体中有一个jsonb列,如示例代码中所示。没有@Audited注释,一切正常。添加审计注释将创建带有uuid而不是jsonb类型的列自定义字段的org_master_aud表,插入失败

@TypeDef(name = "jsonb", typeClass = JsonBinaryType.class)
@Audited
public class OrgMaster {
    @Type(type = "jsonb")
    @Column(columnDefinition = "jsonb",name="custom_fields",nullable=false)
    private JsonNode customFields;
}
在下面的main和audit表中的custom_fields列的快照中可以找到,其中audit表列是uuid,而主表是jsonb。两者都是自动生成的


将hibernate版本从5.4.12.Final更新到5.4.14.Final后,此问题得到解决

这是在版本>5.4.10中引入的错误,在5.4.14中修复。以下是有关jira问题的链接


我使用的是Spring Boot 2.3.1.RELEASE,其中包含hibernate envers 5.4.17.FINAL版。不幸的是,我面临着完全相同的问题。有什么想法吗?
org.springframework.orm.jpa.JpaSystemException: Unable to perform beforeTransactionCompletion callback: org.hibernate.exception.DataException: could not execute statement; nested exception is org.hibernate.HibernateException: Unable to perform beforeTransactionCompletion callback: org.hibernate.exception.DataException: could not execute statement
    at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:353)
.
.
.
.
    at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1352)
    ... 94 more
Caused by: org.postgresql.util.PSQLException: ERROR: invalid input syntax for type uuid: "{}"
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2578)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2313)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:331)
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:448)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:369)
    at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:159)
    at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:125)
    at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
    at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
    at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:197)
    ... 105 more