MattD (5) [Avatar] Offline
#1
Overall, this book is great - thank you!

When describing JDBC and JPA in this chapter, it mentions `data.sql` for JDBC data load, but it does not mention that `import.sql` is used for JPA. It's a small detail, but it tripped me up, and might be helpful to mention somewhere.

Although, in further digging, it looks like that using "import.sql" is only available if you let Hibernate generate the database tables for you, rather than using what is in `data.sql`.

As a result, it looks like these are the following options:
1) Use `data.sql` and `schema.sql` if you set `spring.jpa.hibernate.ddl-auto=none` in `application.properties`
2) Let Hibernate generate the schema automatically, and use `import.sql` to bootstrap the data.

It seems at least a brief mention to this would be helpful.

MattD (5) [Avatar] Offline
#2
Also, in the `Ingredient` class, I found that the `Type type` attribute needed to be marked with `@Enumerated(EnumType.STRING)` in order to get it to properly working when pulling values from the `IngredientRepository`. Without it, there will be an exception:

java.lang.NumberFormatException: For input string: "WRAP"