Понимание интерфейса Spring Data JPA @NoRepositoryBean
Я столкнулся с@NoRepositoryBean
интерфейс несколько раз во время чтения документации Spring Data.
Цитировать из документации:
If you're using automatic repository interface detection using the
Spring namespace using the interface just as is will cause Spring
trying to create an instance of MyRepository. This is of course not
desired as it just acts as indermediate between Repository and the
actual repository interfaces you want to define for each entity. To
exclude an interface extending Repository from being instantiated as
repository instance annotate it with @NoRepositoryBean
.
Тем не менее, я до сих пор не уверен, когда и где его использовать. Может кто-нибудь посоветовать и привести конкретный пример использования?