Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 38add2b

Browse files
authored
Merge pull request #101 from joemccall86/patch-1
Include autowire configuration for example
2 parents b3b70ef + c1c9bc4 commit 38add2b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/src/docs/asciidoc/advancedGORMFeatures/eventsAutoTimestamping.adoc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,19 @@ class Person {
5555
static constraints = {
5656
lastUpdatedBy nullable: true
5757
}
58-
58+
59+
static mapping = {
60+
autowire true
61+
}
62+
5963
def beforeUpdate() {
6064
lastUpdatedBy = securityService.currentAuthenticatedUsername()
6165
}
6266
}
6367
----
6468

69+
Notice the usage of `autowire true` above. This is required for the bean `securityService` to be injected.
70+
6571

6672
==== The beforeDelete event
6773

@@ -382,4 +388,4 @@ autoTimestampEventListener.withoutTimestamps {
382388
}
383389
----
384390

385-
WARNING: Because the timestamp handling is only disabled for the duration of the closure, you must flush the session during the closure execution!
391+
WARNING: Because the timestamp handling is only disabled for the duration of the closure, you must flush the session during the closure execution!

0 commit comments

Comments
 (0)