- Spring Boot 2.0 Cookbook(Second Edition)
- Alex Antonov
- 192字
- 2021-06-24 19:24:40
How it works...
As is evidenced from the browser view, we will get significantly more information than we got when we wrote the books controller. This is in part due to us extending not a CrudRepository interface, but a PagingAndSortingRepository one, which in turn is an extension of CrudRepository. The reason that we've decided to do this is to get the extra benefits provided by PagingAndSortingRepository. This will add the extra functionality to retrieve entities using the pagination and being able to sort them.
The @RepositoryRestResource annotation, while optional, provides us with the ability to have finer control over the exposure of the repository as a web data service. For example, if we wanted to change the URL path or rel value, to writers instead of authors, we could have tuned the annotation as follows:
@RepositoryRestResource(collectionResourceRel = "writers", path = "writers")
As we included spring-boot-starter-data-rest in our build dependencies, we will also get the spring-hateoas library support, which gives us nice ALPS metadata, such as a _links object. This can be very helpful when building an API-driven UI, which can deduce the navigational capabilities from the metadata and present them appropriately.
- 我們都是數據控:用大數據改變商業、生活和思維方式
- 云計算服務保障體系
- WS-BPEL 2.0 Beginner's Guide
- Learning Proxmox VE
- 計算機應用基礎教程上機指導與習題集(微課版)
- Augmented Reality using Appcelerator Titanium Starter
- Web Services Testing with soapUI
- 數據庫應用系統技術
- 企業大數據處理:Spark、Druid、Flume與Kafka應用實踐
- MySQL數據庫實用教程
- 數字化轉型實踐:構建云原生大數據平臺
- 數據時代的品牌智造
- SQL應用開發參考手冊
- Hands-On Big Data Analytics with PySpark
- Getting Started with Review Board