Errata: October 14, 2020
The use of @RequiredArgsConstructor is not strictly necessary here, because @Data implies the generation of a required arguments constructor. (That said, using @RequiredArgsConstructor here does no harm.)
The filterByType() method should be added to the tail end of listing 2.2, just before what is now the final closing curly-brace:
private List<Ingredient> filterByType(
<Ingredient> ingredients, Type type) {
return ingredients
.stream()
.filter(x -> x.getType().equals(type))
.collect(Collectors.toList());
}
The phrase "...is copied into the servlet response attributes,..." should read:
"...is copied into the servlet request attributes,..."
The Design type should be Taco.
@PostMapping
public String processDesign(Taco design) {
// Save the taco design...
// We'll do this in chapter 3
log.info("Processing design: " + design);
return "redirect:/orders/current";
}
The parameter name can also be changed, but what's more imiportant is that the type name be changed.
The sentence following listing 2.5 should read: "...to automatically generate essential JavaBean methods for us at compile time so they will be available at runtime."
The ninth line in listing 3.1 is currently:
"select id, name, type from Ingredient");
It should be:
"select id, name, type from Ingredient where id=?");
The code in Listing 4.2 will require a password encoder. Look at the example in section 4.2.2 for how you might set a password encoder. Or, optionally declare a bean method that returns an implementation of PasswordEncoder.
Text mentions that Spring Boot’s default choice for connection pool is Tomcat JDBC, and this is incorrect. The correct text follows:
Spring Boot uses this connection data when autoconfiguring the `DataSource` bean. The `DataSource` bean will be pooled using the HikariCP connection pool if it’s available on the classpath. If not, Spring Boot looks for and uses one of these other connection pool implementations on the classpath:
Add this note to listing 6.2:
The findAll() method called on TacoRepository in Listing 6.2 accepts a PageRequest object to perform paging. This particular findAll() method is made available by changing TacoRepository so it extends PagingAndSortingRepository instead of CrudRepository. The downloadable sample code has this change in place, but it is never explicitly called out in the book's text.
The first paragraph in the "Handling Rabbit MQ messages with listeners" should read:
For message-driven RabbitMQ beans, Spring offers RabbitListener, the RabbitMQ counterpart to JmsListener. To specify that a method should be invoked when a message arrives in a RabbitMQ queue, annotate a bean’s method with @RabbitListener.