参考: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的书上也不强调一下这一点!

本文介绍如何在 Spring Data JPA 中正确实现自定义方法。遵循特定的命名约定,如将实现类命名为对应 Repository 的名称后缀为 'Impl'。这种实现方式允许您扩展 JPA 的功能并提供额外的操作。

2919

被折叠的 条评论
为什么被折叠?



