From 3014ee2f581b363da15481ea78f685b09f42b380 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Sat, 8 Aug 2015 10:55:41 +0200 Subject: [PATCH] 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. --- .../data/repository/core/support/RepositoryFactorySupport.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java b/src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java index 08f94cbf9..d6ac290db 100644 --- a/src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java +++ b/src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java @@ -28,6 +28,7 @@ import java.util.concurrent.ConcurrentHashMap; import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; import org.springframework.aop.framework.ProxyFactory; +import org.springframework.aop.interceptor.ExposeInvocationInterceptor; import org.springframework.beans.factory.BeanClassLoaderAware; import org.springframework.core.GenericTypeResolver; import org.springframework.core.MethodParameter; @@ -175,6 +176,8 @@ public abstract class RepositoryFactorySupport implements BeanClassLoaderAware { result.setTarget(target); result.setInterfaces(new Class[] { repositoryInterface, Repository.class }); + result.addAdvice(ExposeInvocationInterceptor.INSTANCE); + if (TRANSACTION_PROXY_TYPE != null) { result.addInterface(TRANSACTION_PROXY_TYPE); }