I am using hibernate-envers
with spring
. Everything works just fine, except when I delete an entity, it does not change the values of updated_by
and updated_date
inside audit table, instead it saves an entity exactly as it was before (just copy) after spring.jpa.properties.org.hibernate.envers.store_data_at_delete=true
.
I have already tried to register listener EventType.PRE_DELETE
, but it didn't help.
Here is my UpdateEntity:
@LastModifiedBy
@Column(nullable = false)
private Long updatedBy;
@LastModifiedDate
@Column(nullable = false)
private Date updatedDate;
How can I capture who deleted and when was deleted inside audit table by modifying columns updated_by
and updated_date
?