diff --git a/documentation/src/main/docbook/devguide/en-US/Envers.xml b/documentation/src/main/docbook/devguide/en-US/Envers.xml index 03156d5011..39de7c795d 100644 --- a/documentation/src/main/docbook/devguide/en-US/Envers.xml +++ b/documentation/src/main/docbook/devguide/en-US/Envers.xml @@ -20,6 +20,36 @@ +
+ Basics + + + To audit changes that are performed on an entity, you only need two things: the + hibernate-envers jar on the classpath and an @Audited annotation + on the entity. + + + + And that's all - you can create, modify and delete the entites as always. 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. + + + + Instead of annotating the whole class and auditing all properties, you can annotate + only some persistent properties with @Audited. This will cause only + these properties to be audited. + + + + The audit (history) of an entity can be accessed using the AuditReader interface, which + can be obtained having an open EntityManager or Session via + the AuditReaderFactory. See the javadocs for these classes for details on the + functionality offered. + +
+
Configuration