Skip to content

Commit 6775d11

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 7b791d2 commit 6775d11

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
@@ -27,6 +27,7 @@
2727
import org.aopalliance.intercept.MethodInterceptor;
2828
import org.aopalliance.intercept.MethodInvocation;
2929
import org.springframework.aop.framework.ProxyFactory;
30+
import org.springframework.aop.interceptor.ExposeInvocationInterceptor;
3031
import org.springframework.beans.BeanUtils;
3132
import org.springframework.beans.factory.BeanClassLoaderAware;
3233
import org.springframework.core.GenericTypeResolver;
@@ -188,6 +189,8 @@ public <T> T getRepository(Class<T> repositoryInterface, Object customImplementa
188189
result.setTarget(target);
189190
result.setInterfaces(new Class[] { repositoryInterface, Repository.class });
190191

192+
result.addAdvice(ExposeInvocationInterceptor.INSTANCE);
193+
191194
if (TRANSACTION_PROXY_TYPE != null) {
192195
result.addInterface(TRANSACTION_PROXY_TYPE);
193196
}

0 commit comments

Comments
 (0)