Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 3 JPA problems #113

Open
yiyinggang opened this issue Mar 28, 2022 · 0 comments
Open

Chapter 3 JPA problems #113

yiyinggang opened this issue Mar 28, 2022 · 0 comments

Comments

@yiyinggang
Copy link

  1. spring.jpa.defer-datasource-initialization=true needs to be added to application.properties, otherwise the data.sql will not be executed when spring boot starts.
  2. Add drop table if exists {tablename} cascade; before every create table statement. Change {tablename} to the name of the table being created. This can avoid some problems caused by tables still existing in the memory.
  3. The Type type field of Ingredient entity class should be annotated with @Enumerated(EnumType.STRING), otherwise you'll probably encounter NumberFormatException.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant