From 39cd150ae525ef738c800afd06e37458867f73d5 Mon Sep 17 00:00:00 2001 From: Chris Cranford Date: Mon, 18 Jun 2018 13:04:54 -0400 Subject: [PATCH] HHH-12683 - Add note about CriteriaUpdate/CriteriaDelete not captured by Envers. --- .../main/asciidoc/userguide/chapters/envers/Envers.adoc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/documentation/src/main/asciidoc/userguide/chapters/envers/Envers.adoc b/documentation/src/main/asciidoc/userguide/chapters/envers/Envers.adoc index eea298c94259..aa83e0a162b4 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/envers/Envers.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/envers/Envers.adoc @@ -20,6 +20,13 @@ Just putting the Envers jar on the classpath is enough because listeners will be And that's all. You can create, modify and delete the entities as always. +[IMPORTANT] +==== +The use of JPA's `CriteriaUpdate` and `CriteriaDelete` bulk operations are not currently supported by Envers +due to how an entity's lifecycle events are dispatched. Such operations should be avoided as they're not +captured by Envers and leads to incomplete audit history. +==== + If you look at the generated schema for your entities, or at the data persisted by Hibernate, you will notice that there are no changes. However, for each audited entity, a new table is introduced - `entity_table_AUD`, which stores the historical data, whenever you commit a transaction.