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:
committed by
Oliver Gierke
parent
1c6f544673
commit
a542ff1827
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user