Hello stack overflow
I am creating a demo application for myself using spring-data-jpa and spring-data-rest. I have two repository interfaces:
interface PersonRepository : PagingAndSortingRepository<Person, Long>
@RepositoryRestResource(path = "people", collectionResourceRel = "people", exported = true)
interface PeopleRepository : PagingAndSortingRepository<Person, Long>
I changed the repositoryDetectionStrategy to RepositoryDetectionStrategies.ANNOTATED.
I created for the personRepository a self-made RestController for the peopleRepository I want it to be created by spring and exposed at localhost:8080/ by hateos
Problem
- Just randomly the peopleRepository is exposed(not working at all).
After debugging I can say for sure that RepositoryRestMvcConfiguration's Bean Repositories is the reason for the problem.
org.springframework.data.repository.support.Repositories's method populateRepositoryFactoryInformation gets over all Repositories since I have two for the same Class the inner map.put overrides my desired behavior depending which bean comes first.
So is this a bug or spring does not support several Repository-Interfaces with spring-data-rest or did I misconfigure my setup?