Closed
Description
Andreas Hackl opened DATACMNS-168 and commented
Its not possible to specify two repositories with the same name in different packages, because the beans are registered with the same name (uncapitalized non-qualified class name). So only the repository which was generated at least is in the bean definition or an BeanDefinitionStoreException occurs when bean definition overriding is not allowed.
Provide the ability to specify a specifiy bean name for a repository or a custom BeanNameGenerator strategy for bean name resolution. This is already possible in the core spring framework for naming autodetected components.
@Repository("myRepositoryBeanName")
public interface MyRepository extends Respository<...> {
// ...
}
or
<beans ...>
<jpa:repositories base-package="org.example" name-generator="org.example.MyNameGenerator" />
</beans>
Issue Links:
- DATACMNS-169 Handle naming collisions of interfaces when scanning and registering repository bean definitions
Referenced from: commits 874da36, b4a553e
Backported to: 1.5 Final, 1.4.1
1 votes, 5 watchers