Spring Data REST exposes Spring Data repositories as RESTful resources, allowing a Spring Boot application to manage persistent entities through HTTP rather than hand-written controllers. section 2.2 section 16.2
A practical Spring Data REST application combines:
- Spring Web, Spring Data JPA, REST Repositories, and a MySQL driver in Maven. section 16.2
- Spring Boot properties for the server port, datasource, Hibernate dialect, SQL logging, and schema generation. section 16.2
- JPA entities, including a version field that supports conditional REST requests with ETags. section 16.2 section 16.7
- A repository interface extending JpaRepository, which Spring Data REST can export automatically. section 16.2 section 16.4
Restricting the exported API
Map a repository to /users, disable deletion, and hide an entity field: @RepositoryRestResource(path = "users") on UserRepository, @RestResource(exported = false) on delete methods, and @JsonIgnore on isRegistered(). Requests to the disabled repository return 404, disabled deletion returns 405, and the ignored field disappears from REST responses. section 16.4
Use the project-creation figure to inspect the Spring Boot and MySQL setup that starts the application. section 16.2

