You just have to love open source :-)
A quick src code study brought up the solution. For anybody else facing a
similar problem, simply extend from AuditEventListener and override
public override void
//check if object has a a property State
var mod = evt.Entity as IHasState;
if (mod != null)
var index =
if (index != -1)
evt.DeletedState[index] = State.Deleted;
Register your extended auditlistener at envers and you are done.
Am Montag, 19. September 2016 17:50:56 UTC+2 schrieb PeSo:
> anybody every needed to intercept and change a deleted entry? I know there
> is a config entry called nhibernate.envers.store_data_at_delete.
> The problem is that we must be able to search by deleted entries in our
> history and all queries check against our own Status column (ie not against
> So in addition to storing data at delete I must also change this status
> column to deleted.
> What would be the best extension point in Envers for this behavior? Can I
> intercept the audit object before it gets written to the database?
> best regards,
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to firstname.lastname@example.org.
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.