Skip to content

Commit f889d5c

Browse files
committed
Expose BeanFactory to RepositoryFactorySupport implementations.
Some implementations (Spring Data JPA especially) need access to the underlying BeanFactory. Add a protected getter. Related: spring-projects/spring-data-jpa#2162 Closes #2614
1 parent 7eb0fa0 commit f889d5c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import org.aopalliance.intercept.MethodInvocation;
3030
import org.apache.commons.logging.Log;
3131
import org.apache.commons.logging.LogFactory;
32-
3332
import org.springframework.aop.framework.ProxyFactory;
3433
import org.springframework.aop.interceptor.ExposeInvocationInterceptor;
3534
import org.springframework.beans.BeanUtils;
@@ -365,8 +364,7 @@ public <T> T getRepository(Class<T> repositoryInterface, RepositoryFragments fra
365364

366365
if (logger.isDebugEnabled()) {
367366
logger
368-
.debug(LogMessage.format("Finished creation of repository instance for %s.",
369-
repositoryInterface.getName()));
367+
.debug(LogMessage.format("Finished creation of repository instance for %s.", repositoryInterface.getName()));
370368
}
371369

372370
return repository;
@@ -520,6 +518,10 @@ protected void validate(RepositoryMetadata repositoryMetadata) {
520518

521519
}
522520

521+
protected BeanFactory getBeanFactory() {
522+
return this.beanFactory;
523+
}
524+
523525
/**
524526
* Creates a repository of the repository base class defined in the given {@link RepositoryInformation} using
525527
* reflection.

0 commit comments

Comments
 (0)