No property found for type error when try to create custom repository with Spring Data JPA

前端 未结 2 463
半阙折子戏
半阙折子戏 2020-12-07 20:24

I have a Media entity that has some basic fields for files uploaded by the user. For saving the bytes of the files uploaded, I want to create a custom repository that holds

相关标签:
2条回答
  • 2020-12-07 21:08

    You wrote:

    the suggestions there (all in same package, naming convention) are things I'm already doing.

    No you do not.

    Rename you MediaBytesRepository to MediaRepositoryCustom.

    And of course you need an implementation of MediaRepositoryCustom with the name MediaRepositoryImpl.

    0 讨论(0)
  • 2020-12-07 21:16

    You must name your impl class as "InterfaceNameImpl". Default postfix for implementation is Impl, we can change it as we like:

    <repositories base-package="com.acme.repository" repository-impl-postfix="FooBar" />
    

    The name of custom interfaces does not matter.

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