这里的问题是你正在创建,
FilterRepositoryImpl但正在中使用它
UserRepository。你需要进行创建
UserRepositoryImpl才能完成这项工作。
阅读此文档以获取更多详细信息
基本上
public interface UserRepositoryCustom { List<User> filterBy(String role);}public class UserRepositoryImpl implements UserRepositoryCustom {...}public interface UserRepository extends JpaRepository<User, String>, UserRepositoryCustom {...}Spring Data 2.x更新
此答案是为Spring 1.x编写的。正如Matt Forsythe指出的那样,命名期望随着Spring Data 2.0的改变而改变。实现从更改
the-final-repository-interface-name-with-an-additional-Impl-suffix为
the-custom-interface-name-with-an-additional-Impl-suffix。
因此,在这种情况下,实现的名称为:
UserRepositoryCustomImpl。



