- 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.
- Spark核心技術與高級應用
- 3D計算機視覺:原理、算法及應用
- 數(shù)據(jù)革命:大數(shù)據(jù)價值實現(xiàn)方法、技術與案例
- OracleDBA實戰(zhàn)攻略:運維管理、診斷優(yōu)化、高可用與最佳實踐
- The Game Jam Survival Guide
- MATLAB Graphics and Data Visualization Cookbook
- AI時代的數(shù)據(jù)價值創(chuàng)造:從數(shù)據(jù)底座到大模型應用落地
- Oracle高性能SQL引擎剖析:SQL優(yōu)化與調(diào)優(yōu)機制詳解
- Unity 2018 By Example(Second Edition)
- 區(qū)塊鏈+:落地場景與應用實戰(zhàn)
- openGauss數(shù)據(jù)庫核心技術
- SQL Server 2008寶典(第2版)
- 數(shù)據(jù)賦能
- MySQL技術內(nèi)幕:InnoDB存儲引擎
- 從Lucene到Elasticsearch:全文檢索實戰(zhàn)