spring_reference/IV. Spring Boot features/29.4.2. Spring Data Solr re...

9 lines
536 B
Markdown
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### 29.4.2. Spring Data Solr仓库
Spring Data的仓库包括了对Apache Solr的支持。正如上面讨论的JPA仓库基本的原则是查询会自动基于你的方法名创建。
实际上不管是Spring Data JPA还是Spring Data Solr都共享相同的基础设施。所以你可以使用上面的JPA示例并假设那个City现在是一个@SolrDocument类而不是JPA @Entity它将以同样的方式工作。
**注**:具体参考[Spring Data Solr文档](http://projects.spring.io/spring-data-solr/)。