Skip to content

Commit 3014ee2

Browse files
committed
DATACMNS-749 - RepositoryFactorySupport now registers global ExposeInvocationInterceptor.
This frees RepositoryProxyPostProcessors from having to register the interceptor manually and thus prevents it from being registered multiple times.
1 parent 7b16798 commit 3014ee2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.aopalliance.intercept.MethodInterceptor;
2929
import org.aopalliance.intercept.MethodInvocation;
3030
import org.springframework.aop.framework.ProxyFactory;
31+
import org.springframework.aop.interceptor.ExposeInvocationInterceptor;
3132
import org.springframework.beans.factory.BeanClassLoaderAware;
3233
import org.springframework.core.GenericTypeResolver;
3334
import org.springframework.core.MethodParameter;
@@ -175,6 +176,8 @@ public <T> T getRepository(Class<T> repositoryInterface, Object customImplementa
175176
result.setTarget(target);
176177
result.setInterfaces(new Class[] { repositoryInterface, Repository.class });
177178

179+
result.addAdvice(ExposeInvocationInterceptor.INSTANCE);
180+
178181
if (TRANSACTION_PROXY_TYPE != null) {
179182
result.addInterface(TRANSACTION_PROXY_TYPE);
180183
}

0 commit comments

Comments
 (0)