Loading tutorials
pom.xml, run a command in a terminal, and have JDK 17 or later installed. Gradle works the same way. The examples use Maven be5 min readapplication.properties file and know what a JDBC URL is. It also as5 min readBook resource to a database table with JPA. It assumes you know Java classes, annotations, and basic SQL, and that the project from the earlier chapters already has spring-boot-starter-data-jpa and a configured database. The chapter covers the working model, the6 min readBookRepository interface gives the API access to the book table without any implementation code. It assumes you can read Java interfaces and generics, you know basic SQL (select, where, like), and the Book entity from the previous chapter is in place. It also a5 min read@RestController returns JSON. It covers why the API should expose its own request and response types instead of the Book entity, how to write them, and where the mapping code belongs.6 min readBookService method by method. It also covers the mistakes that most often appear in this layer.5 min read@Transactional. It assumes you have read the earlier chapters on the JPA entity, the repository, and the service layer. You should also know what a relational tr5 min readBook entity, BookRepository, BookRequest/BookResponse records, and BookService from the earlier chapters. You should also know the basic HTTP methods and the status code classes (2xx success, 4xx client error, 5xx server error). Here you will wire the serv5 min readBookRequest, trigger them from the controller, and return a consistent 400 response that names each bad field. It assumes you have the controller, DTO records, and ApiExceptionHandler from the earlier chapters, an5 min readBookController, BookService, BookRequest with its @NotBlank annotations, and BookNotFoundException. You should also know what an HTTP status code is and how Java exceptions propagate. By the end, every failure the AP5 min readGET /api/books. It assumes you have the BookRepository, BookService, and BookController from the earlier chapters, and that you know basic JPA and SQL. You should also know what LIMIT, OFFSET, and ORDER BY do.6 min readBookController and ApiExceptionHandler you built earlier. It assumes you can read JUnit 5 tests, know the basics of Mockito (when, verify), and understand the controller, service, and validation code from the previous chapters.4 min read