参考:https://stackoverflow.com/questions/20777785/org-springframework-data-mapping-propertyreferenceexception-no-property-catch-f
If the name of your jpa repository interface is LocaleJpaRepository
, your new custom interface should be named LocaleJpaRepositoryCustom
, but the class that makes the override in the method must be named LocaleJpaRepositoryImpl
, as it follows:
public class LocalJpaRepositoryImpl implements LocalJpaRepositoryCustom{
@Override
public void customMethod(){....}
}
Basically, the implementation class of your custom interface should start with the name of your repository interface (JPARepository) ending with 'Impl' keyword.
只能说大水坑啊,Spring Data的书上也不强调一下这一点!