We're updating the issue view to help you get more done. 

Envers: Missing support of CriteriaDelete and CriteriaUpdate

Description

I am using Hibernate Envers in my project along with a lot of CriteriaDelete and CriteriaUpdate queries.

The problem now is, that with CriteriaDelete and CriteriaUpdate the auditing does not work properly! That makes using an auditing tool worthless.

Example:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 @Audited public class A { //... @Basic private String myString; } public class AManager { // ... @Transactional public void deleteByMyString(String myString) { CriteriaBuilder cb = getEntityManager().getCriteriaBuilder(); CriteriaDelete<A> query = cb.createCriteriaDelete(A.class); Root<A> root = query.from(A.class); getEntityManager().createQuery(query.where(cb.equal(root.get("myString"), myString))).executeUpdate(); } }

After executing aManager.deleteByMyString("xyz") which deletes at least 1 row, no A_AUD entry with revtype=2 is created.

Environment

hibernate-entitymanager: 5.0.4.Final
hibernate-envers: 5.0.4.Final
PostgreSQL: 9.2

Status

Assignee

Unassigned

Reporter

Marcel

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

5.0.4

Priority

Major