Spring Boot Configuration
Hibernate is the most popular implementation of JPA. The Java Persistence API provides Java developers with an api for mapping java objects to relational data. In this article, you will learn about Spring Boot database configuration.
Configure application.properties:
Restart the app and you are ready!
Things to note:
- Spring Boot chooses a default value for you based on whether it thinks your database is embedded (default create-drop) or not (default none).
- spring.jpa.hibernate.ddl-auto is the setting to perform SchemaManagementTool actions automatically
- none: No action will be performed.
- create-only: Database creation will be generated.
- drop: Database dropping will be generated.
- create: Database dropping will be generated followed by database creation.
- validate: Validate the database schema
- update: Update the database schema
- Reference: https://docs.jboss.org/hibernate/orm/5.2/userguide/html_single/Hibernate_User_Guide.html#configurations-hbmddl