DATAJPA-850 - Added documentation on how to use the @EntityListeners annotation to enable auditing.

Added instructions to the reference documentation on how to register the AuditingEntityListener using JPA's @EntityListeners annotation.

Original pull request: #163.
This commit is contained in:
Wim Deblauwe
2016-01-20 16:25:28 +01:00
committed by Oliver Gierke
parent 1c6f544673
commit a542ff1827

View File

@@ -744,6 +744,19 @@ Note that the auditing feature requires `spring-aspects.jar` to be on the classp
----
====
You can also enable the `AuditingEntityListener` per entity using the `@EntityListeners` annotation:
====
[source, java]
----
@Entity
@EntityListeners(AuditingEntityListener.class)
public class MyEntity {
}
----
====
Now activating auditing functionality is just a matter of adding the Spring Data JPA `auditing` namespace element to your configuration:
.Activating auditing using XML configuration