I’m using a Embeddable Object to store i18n in a JSONB-Column like this:
{noformat}@Table(schema = "mdata", name = "PART") @Audited(withModifiedFlag = true) public class Part {
@JdbcTypeCode(SqlTypes.JSON) Translation description; ... {noformat}
with
{noformat}@Embeddable public class Translation { String de; String en; } {noformat}
All changes to the Part entity trigger an entry in the envers-table PART_AUD, but
* changes to the JSONB description-column are not marked as modified and the * jsonb-values in the PART_AUD are always NULL.
I have added a Quarkus Sample-Project with a test-case.
My findings so far:
I use Flyway to create the tables → the _AUD table has a jsonb-column, like the original table.
Without flyway, if i configure the project to let hibernate create the tables, the _AUD table has separate STRING columns for each field in the embeddable! This seems odd…
In the insert-statement that envers generates the jsonb-column is missing at all (see console-log of my test):
{code:sql} insert into base.PART_AUD (REVTYPE,description_MOD,name,name_MOD,stamp,stamp_MOD,REV,id) values (?,?,?,?,?,?,?,?){code}
may this is releated to [https://hibernate.atlassian.net/browse/HHH-16910|https://hibernate.atlassian.net/browse/HHH-16910|smart-link] |
|