Loading tutorials
application.properties file and know what JDBC is. You should also know basic SQL and have the Maven project from the previous chapter. By the end, the application will connect to PostgreSQL with credentials kept out of the source code.2 min readBook entity, a configured datasource, and basic knowledge of Java interfaces and generics. You need to know what a JPA entity is, but not how Hibernate works internally.3 min readBook entity and BookRepository from the earlier chapters. A DTO (data transfer object) is a plain class that carries data across a boundary. Here the boundary is the HTTP API.2 min readBook entity, a BookRepository, and the BookRequest and BookResponse records from the earlier chapters. You should also know what constructor injection is.2 min readBookService from the previous chapter, a working Spring Data repository, and basic knowledge of what a database transaction is: a group of operations that either all succeed or all fail.2 min readBookService, BookRequest, and BookResponse types from the earlier chapters, and that you know basic HTTP methods and Spring annotations. The controller is the web layer of the application. It receives HTTP requests, hands the work to the service, and turns the2 min readBook entity, BookRepository, DTO records, and BookService from the earlier chapters. It also assumes you know the basic HTTP methods and status code classes. Here you wire the service into a controller and choose the right status code for each outcome.2 min readBookRequest record, the BookController, and the spring-boot-starter-validation dependency from the earlier chapters. You should also know what an annotation is and what a 400 status code means.2 min read@Valid request validation from the earlier chapters. You should also know that Spring maps exceptions to HTTP responses.2 min readBookRepository, BookService, and BookController from earlier chapters. You should also know what a Pageable is at a basic level and how Spring MVC binds query parameters. Here you will see how the list endpoint returns one page of books at a time, in a3 min readBookController, BookService, BookNotFoundException, and ApiExceptionHandler classes from the earlier chapters. It also assumes you know basic JUnit 5 and Mockito. You will write tests that check status codes and JSON without starting a server or a database.2 min read