In my audited entity i have fields:
@LastModifiedBy
private String lastModifiedBy;
@LastModifiedDate
private OffsetDateTime lastModifiedDate;
But they doesn't change when entity is deleted.
As i understand, i need to customize org.springframework.data.jpa.domain.support.AuditingEntityListener
and add @PreRemove
there, but i dont understand how to implement this, because i'm always have
org.hibernate.InstantiationException: Could not instantiate managed bean directly
Is there any other options to track delete events and store updated fields to Envers audit table ?