Skip to content

Commit 7f61bce

Browse files
Pavel Gnusinmp911de
Pavel Gnusin
authored andcommitted
Look up bean merged bean definitions in Repositories.
We now look up bean definitions for repositories using BeanFactory.getMergedBeanDefinition(…) to consider parent-child relationships across application contexts. As we iterate through bean definitions considering ancestors we need to allow parent bean definitions. Previously, we obtained the bean definition from the child context and since the bean was inherited from the parent, the child context cannot provide a bean definition. Closes #2383 Original pull request: #2384.
1 parent f87ae36 commit 7f61bce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/springframework/data/repository/support/Repositories.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ private void cacheFirstOrPrimary(Class<?> type, RepositoryFactoryInformation inf
306306
return null;
307307
});
308308

309-
Boolean presentAndPrimary = factoryToUse.map(it -> it.getBeanDefinition(name)) //
309+
Boolean presentAndPrimary = factoryToUse.map(it -> it.getMergedBeanDefinition(name)) //
310310
.map(BeanDefinition::isPrimary) //
311311
.orElse(false);
312312

0 commit comments

Comments
 (0)