This question was already discussed here, however, it did not solve my problem.
Let's have simple audited class Person with some String information like name, etc. and with List of String email addresses. Now I want to remove specific person from database along with all its revisions. I know, this is not common use-case for Envers, but it is crucial for my project. I understand, that I can use something like this:
"delete from full.package.name.Person_AUD u where u.originalId.id = :personid"
However, this does not delete records related to this person in table of emails, as there is no constraint about this relation. Or am I doing something wrong?
I was also thinking about deleting record from REVINFO table (there are constraints in audit tables about relation to REVINFO table), but this is not safe, as there can be more entities modified in one transaction and therefore more entities could have the same revision number.
My question is: Is there any easy way to delete all records from all audit tables for any person?