Skip to content

Commit a542ff1

Browse files
wimdeblauweodrotbohm
authored andcommitted
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.
1 parent 1c6f544 commit a542ff1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/main/asciidoc/jpa.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,19 @@ Note that the auditing feature requires `spring-aspects.jar` to be on the classp
744744
----
745745
====
746746

747+
You can also enable the `AuditingEntityListener` per entity using the `@EntityListeners` annotation:
748+
749+
====
750+
[source, java]
751+
----
752+
@Entity
753+
@EntityListeners(AuditingEntityListener.class)
754+
public class MyEntity {
755+
756+
}
757+
----
758+
====
759+
747760
Now activating auditing functionality is just a matter of adding the Spring Data JPA `auditing` namespace element to your configuration:
748761

749762
.Activating auditing using XML configuration

0 commit comments

Comments
 (0)