ganaraj tejasvi (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiODgxNmEyM2Iw...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-14003?atlOrigin=eyJpIjoiODgxNm...
) HHH-14003 (
https://hibernate.atlassian.net/browse/HHH-14003?atlOrigin=eyJpIjoiODgxNm...
) Hibernate Envers audit Table Column Changes from jsonb to uuid (
https://hibernate.atlassian.net/browse/HHH-14003?atlOrigin=eyJpIjoiODgxNm...
)
Issue Type: Bug Affects Versions: 5.4.14 Assignee: Chris Cranford (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) Attachments: Screenshot 2020-05-05 at 8.55.48 PM.png, Screenshot 2020-05-05 at 8.56.46
PM.png Components: hibernate-envers Created: 05/May/2020 10:13 AM Priority: Minor
Reporter: ganaraj tejasvi (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
I have a jsonb column in an Entity annotated as shown in the sample code. Everything works
fine without the @Audited annotation. Adding the Audited annotation creates the
org_master_aud table with the column custom_fields of type uuid instead of jsonb and the
insert fails
```
@TypeDef(name = "jsonb", typeClass = JsonBinaryType.class)
@Audited
public class OrgMaster
{ @Type(type = "jsonb") @Column(columnDefinition =
"jsonb",name="custom_fields",nullable=false) private JsonNode
customFields; }
```
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
Attached (
https://hibernate.atlassian.net/secure/attachment/49674/49674_Screenshot+...
) (
https://hibernate.atlassian.net/secure/attachment/49673/49673_Screenshot+...
) the Snapshots of the custom_fields column in main and audit table where the audit table
column is uuid whereas the main table is jsonb. Both are autogenerated.
(
https://hibernate.atlassian.net/browse/HHH-14003#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-14003#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100126- sha1:bfbb988 )