- We will start by adding another dependency to our build.gradle file in order to add the spring-boot-starter-data-rest artifact:
dependencies {
...
compile("org.springframework.boot:spring-boot-starter-data-rest")
...
}
- Now, let's create a new interface to define AuthorRepository in the src/main/java/com/example/bookpub/repository directory from the root of our project with the following content:
@RepositoryRestResource
public interface AuthorRepository extends
PagingAndSortingRepository<Author, Long> {
}
- While we are at it—given how little code it takes—let's create the repository interfaces for the remaining entity models, PublisherRepository and ReviewerRepository by placing the files in the same package directory ...