私は、春の@Repository
と@RepositoryDefinition
の違いを知りたいと思います。そして、それは@EnableNeo4jRepositories
で有効になりますか?@Repositoryと@RepositoryDefinitionの違いは何ですか?
1
A
答えて
4
私はNeo4jに関して答えることができませんが、2つのSpringアノテーションの間の決定は設計上の決定です。私はofficial documentationから引用されます:
通常、リポジトリのインターフェースが
Repository
、CrudRepository
またはPagingAndSortingRepository
を拡張します。また、 がSpringデータインタフェースを拡張したくない場合は、 リポジトリインタフェースに@RepositoryDefinition
と注釈を付けることもできます。
API docはより明確である:RepositoryDefinition
とのインタフェースを注釈
は
Repository
を拡張するのと同じ動作が発生します。
Using @RepositoryDefinition and JpaSpecificationExecutor methods doesn't workにも興味があります。
関連する問題
- 1. Tortoise svn repositoryとvisual svn repositoryの違いは何ですか?
- 2. SVN:Base RevisionとRepository from Latestの違いは何ですか?
- 3. $と$$の違いは何ですか?
- 4. `##`と `hashCode`の違いは何ですか?
- 5. typedefとの違いは何ですか?
- 6. NodeJS:「./ ..」と「..」の違いは何ですか?
- 7. {}())と{})の違いは何ですか?
- 8. `&`と `ref`の違いは何ですか?
- 9. `==`と `is`の違いは何ですか?
- 10. difftimeと ' - 'の違いは何ですか?
- 11. #{} $ {}と%{}の違いは何ですか?
- 12. ⊕と+の違いは何ですか?
- 13. アペンダーと〜の違いは何ですか?
- 14. "./"と "../"の違いは何ですか?
- 15. "$^N"と "$ +"の違いは何ですか?
- 16. %Qと%{}の違いは何ですか?
- 17. バックスティックと$()の違いは何ですか?
- 18. A`と ``の違いは何ですか[:] `
- 19. パッケージのインポートobjと何かの違いをインポートパッケージとPythonの何かの違いは何ですか?
- 20. METADATAとMETADATA.jl:違いは何ですか?
- 21. twistdとnohup&:違いは何ですか?
- 22. libspeとlibspe2?違いは何ですか?
- 23. Backbone.jsとPusherapp - 違いは何ですか?
- 24. wp_link_pagesとthe_posts_pagination→違いは何ですか?
- 25. $ dirtyと$ invalid:違いは何ですか?
- 26. XPathの//と?/の違いは何ですか?の使用は何
- 27. フレームとオブジェクトの違いは何ですか?フレームとオブジェクトの違いは何ですか?
- 28. リストと何か([_])と何か(_)の違い
- 29. 違いは何ですか?
- 30. 違いは何ですか?
あなたは '@ Repository'をSpring Dataインターフェースと組み合わせて使う必要はありません。それはよくある誤解です。 '@ Repository'は、インターフェースではなく、リポジトリ層の実装に追加するメタ注釈です(基本的に' @ Component'と同じ機能です)。 – dunni