org.springframework.data.mapping.PropertyReferenceException: No property catch found for type

后端 未结 2 727
陌清茗
陌清茗 2020-12-07 19:20

I have a issue with Spring Data repositories.

When I deploy, I get an exception and it\'s because Spring Data tries to derive dynamically the method, but can\'t find

相关标签:
2条回答
  • 2020-12-07 19:33

    I had a issue like this and my mistake was the name of the custom repository class:

    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.

    0 讨论(0)
  • 2020-12-07 19:39

    Custom Repository Implementation class name should be Interface name which is extending JPARepositry with Impl

    0 讨论(0)
提交回复
热议问题