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/java/org/springframework/data/repository/core/support/EventPublishingRepositoryProxyPostProcessor.java
+13-7
Original file line number
Diff line number
Diff line change
@@ -38,15 +38,17 @@
38
38
importorg.springframework.util.ReflectionUtils;
39
39
40
40
/**
41
-
* {@link RepositoryProxyPostProcessor} to register a {@link MethodInterceptor} to intercept the
42
-
* {@link CrudRepository#save(Object)} method and publish events potentially exposed via a method annotated with
43
-
* {@link DomainEvents}. If no such method can be detected on the aggregate root, no interceptor is added. Additionally,
41
+
* {@link RepositoryProxyPostProcessor} to register a {@link MethodInterceptor} to intercept
42
+
* {@link CrudRepository#save(Object)} and {@link CrudRepository#delete(Object)} methods and publish events potentially
43
+
* exposed via a method annotated with {@link DomainEvents}. If no such method can be detected on the aggregate root, no
44
+
* interceptor is added. Additionally,
44
45
* the aggregate root can expose a method annotated with {@link AfterDomainEventPublication}. If present, the method
45
46
* will be invoked after all events have been published.
46
47
*
47
48
* @author Oliver Gierke
48
49
* @author Christoph Strobl
49
50
* @author Yuki Yoshida
51
+
* @author Réda Housni Alaoui
50
52
* @since 1.13
51
53
* @soundtrack Henrik Freischlader Trio - Master Plan (Openness)
52
54
*/
@@ -75,7 +77,7 @@ public void postProcess(ProxyFactory factory, RepositoryInformation repositoryIn
75
77
}
76
78
77
79
/**
78
-
* {@link MethodInterceptor} to publish events exposed an aggregate on calls to a save method on the repository.
80
+
* {@link MethodInterceptor} to publish events exposed an aggregate on calls to a save or delete method on the repository.
79
81
*
80
82
* @author Oliver Gierke
81
83
* @since 1.13
@@ -106,12 +108,16 @@ public Object invoke(@SuppressWarnings("null") MethodInvocation invocation) thro
106
108
Object[] arguments = invocation.getArguments();
107
109
Objectresult = invocation.proceed();
108
110
109
-
if (!invocation.getMethod().getName().startsWith("save")) {
Copy file name to clipboardExpand all lines: src/test/java/org/springframework/data/repository/core/support/EventPublishingRepositoryProxyPostProcessorUnitTests.java
+40
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,7 @@
53
53
* @author Oliver Gierke
54
54
* @author Mark Paluch
55
55
* @author Yuki Yoshida
56
+
* @author Réda Housni Alaoui
56
57
* @soundtrack Henrik Freischlader Trio - Nobody Else To Blame (Openness)
0 commit comments