为某一个Repository添加自定义方法
- 步骤
- 定义一个接口:声明要添加的方法。
- 提供该接口的实现类:类名需要在声明的Repository后添加Impl,并实现方法
- 声明Repository接口,并继承声明的接口
- 默认情况下,Spring Data 会在 base-package中查找接口名为Impl 作为实现类 ,也可通过repository-impl-postfix 声明后缀
public interface PersonDao {
void test();
}
public class PersonRepsotoryImpl</