You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/asciidoc/jdbc.adoc
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -833,8 +833,10 @@ Note that the type used for prefixing the statement name is the name of the aggr
833
833
== Lifecycle Events
834
834
835
835
Spring Data JDBC triggers events that get published to any matching `ApplicationListener` beans in the application context.
836
+
Events and callbacks get only triggered for aggregate roots.
837
+
If you want to process non-root entities, you need to do that through a listener for the containing aggregate root.
836
838
837
-
Entity lifecycle events can be costly and you may notice a change in the performance profile when loading large result sets.
839
+
Entity lifecycle events can be costly, and you may notice a change in the performance profile when loading large result sets.
838
840
You can disable lifecycle events on the link:{javadoc-base}org/springframework/data/jdbc/core/JdbcAggregateTemplate.html#setEntityLifecycleEventsEnabled(boolean)[Template API].
839
841
840
842
For example, the following listener gets invoked before an aggregate gets saved:
If you want to handle events only for a specific domain type you may derive your listener from `AbstractRelationalEventListener` and overwrite one or more of the `onXXX` methods, where `XXX` stands for an event type.
858
-
Callback methods will only get invoked for events related to the domain type and their subtypes so you don't require further casting.
860
+
Callback methods will only get invoked for events related to the domain type and their subtypes, therefore you don't require further casting.
0 commit comments