DATACMNS-764 - Documentation polish.

Related pull request: #201.
This commit is contained in:
Oliver Gierke
2017-06-13 17:31:24 +02:00
parent 13907152fb
commit f0fa12340a

View File

@@ -649,11 +649,13 @@ If you use namespace configuration, the repository infrastructure tries to autod
The first configuration example will try to look up a class `com.acme.repository.UserRepositoryImpl` to act as custom repository implementation, whereas the second example will try to lookup `com.acme.repository.UserRepositoryFooBar`.
[[repositories.single-repository-behaviour.ambiguity]]
===== Resolution of ambiguity
If multiple implementations with matching class names get found in different packages Spring Data uses the bean names to identify the correct one to use.
If multiple implementations with matching class names get found in different packages, Spring Data uses the bean names to identify the correct one to use.
Given the following two custom implementations for the `UserRepository` introduced above the first implementation will get picked. Its bean name is `userRepositoryImpl` matches that of the repository interface (`userRepository`) plus the postfix `Impl`.
Given the following two custom implementations for the `UserRepository` introduced above the first implementation will get picked.
Its bean name is `userRepositoryImpl` matches that of the repository interface (`userRepository`) plus the postfix `Impl`.
.Resolution of amibiguous implementations
====
@@ -678,7 +680,7 @@ class UserRepositoryImpl implements UserRepositoryCustom {
----
====
If you annotate the `UserRepository` interface with `Component("specialCustom")' the bean name plus `Impl` matches that of the second Repository and it will be picked instead of the first one.
If you annotate the `UserRepository` interface with `@Component("specialCustom")` the bean name plus `Impl` matches the one defined for the repository implementation in `com.acme.impl.two` and it will be picked instead of the first one.
===== Manual wiring