Hi, I’ve encountered a similar problem also doing a Spring Boot 2.7 → 3.0 upgrade. We have entities with Instant fields which are mapped to DATE columns in our Oracle DB. As of Hibernate 6 the default mapping for Instant is to TIMESTAMP WITH TIME ZONE columns, but this default can be overridden by setting hibernate.type.preferred_instant_jdbc_type=TIMESTAMP. However it appears that envers doesn’t recognise this option, and adding a @JdbcType or @JdbcTypeCode annotation explicitly on the entity fields doesn’t work either. This results in errors like this when inserting audit records:
For me there’s a simple workaround of creating an AttributeConverter to explicitly define the mapping behaviour I want, which envers does pick up and apply to its generated entity definitions (you can see this in the envers HBM dump where the field type is marked as converted::). But I’d expect all of the type mapping logic which applies to the entity class to be applied to the audit entity in a consistent way. |