【发布时间】:2019-06-22 12:33:59
【问题描述】:
我有一项服务需要使用Neo4jRepository(spring data 的常规存储库提供程序)。
public class SomeServiceBean<T>{
@Autowired
private Neo4jRepository<T,Long> Neo4jRepository;
}
这个类会产生 en 错误:
expected single matching bean but found 2: systemUserRepository,systemClaimRepository
问题在于systemClaimRepository 和systemUserRepository 将Neo4jRepository<T,Long> 扩展为没有实现的bean。
Spring 将 systemClaimRepository 和 systemUserRepository 视为 Neo4jRepository<T,Long>,因为它们正在扩展它。
有没有办法注入Neo4jRepository<T,Long>?
谢谢
【问题讨论】:
标签: spring-data autowired