当同一域类型存在两个存储库接口时,Spring Data Rest公开RepositoryRestResource会随机失败
Hello堆栈溢出 我正在使用SpringDataJPA和SpringDataREST为自己创建一个演示应用程序。我有两个存储库接口:当同一域类型存在两个存储库接口时,Spring Data Rest公开RepositoryRestResource会随机失败,spring,spring-data-rest,Spring,Spring Data Rest,Hello堆栈溢出 我正在使用SpringDataJPA和SpringDataREST为自己创建一个演示应用程序。我有两个存储库接口: interface PersonRepository : PagingAndSortingRepository<Person, Long> @RepositoryRestResource(path = "people", collectionResourceRel = "people", exported = true) interface Peo
interface PersonRepository : PagingAndSortingRepository<Person, Long>
@RepositoryRestResource(path = "people", collectionResourceRel = "people", exported = true)
interface PeopleRepository : PagingAndSortingRepository<Person, Long>
接口PersonRepository:PagingAndSortingRepository
@RepositoryRestResource(path=“people”,collectionResourceRel=“people”,exported=true)
接口人员存储库:分页和排序存储库
我将repositoryDetectionStrategy更改为RepositoryDetectionStrategys.ANNOTATED
我为personRepository创建了一个自制的RestController,用于peopleRepository我希望它由spring创建,并在localhost:8080/由hateos公开
问题
- 只是随机暴露peopleRepository(根本不工作)李>
那么这是一个bug还是spring不支持使用spring data rest的多个存储库接口,还是我对设置有误?遗憾的是,
SpringData
似乎不能很好地处理这种情况(我使用的是spring boot 1.5.8,当时我发现了与您相同的问题…我试图升级我的spring版本,看看这是否已修复,但我开始遇到其他编译/部署问题。因此我放弃了这个想法…)
您可以通过以下链接获得更多信息: