The problem here is that you are creating FilterRepositoryImpl
but you are using it in UserRepository
. You need to create UserRepositoryImpl
to make this work.
Basically
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 update
This answer was written for Spring 1.x. As Matt Forsythe pointed out, the naming expectations changed with Spring Data 2.0. The implementation changed from the-final-repository-interface-name-with-an-additional-Impl-suffix
to the-custom-interface-name-with-an-additional-Impl-suffix
.
So in this case, the name of the implementation would be: UserRepositoryCustomImpl
.