| Well, for HQL statements I would accept your answer, but I am using standard JPA 2.1 features. Why should one ever use Envers, when that restricts the possibilities that much? Instead of
delete from ... where ...
I now have to do a
select id from ... where ...
-- For each result:
em().remove();
This is not only slow, but also inconvenient and when someone else looks at that code, he will optimize it to the first statement and voilĂ , no more auditing! I do not think, that it is that much difficult to introduce this 'feature' (although I still think that this is a big bug). For example when executeUpdate() is called on CriteriaDelete, Envers could simply extract the conditions and then select the matching ids and do the auditing stuff. Same for CriteriaUpdate. There is no need to have the users do that stuff! But that is just my point of view... But I would really appreciate a solution! |