Developing Java Applications with Spring and Spring Boot
by Claudio Eduardo de Oliveira, Greg L. Turnquist, Alex Antonov
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, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access