Here is a sample application.properties configuration that will let Hibernate create the Database tables out of your Entity beans:

spring.datasource.url=jdbc:mysql://localhost:3306/mysqltutorial?useSSL=false
spring.datasource.username=root
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto = create

Here are the possible values for hibernate.hbm2ddl.auto :

  • validate: validate the schema, makes no changes to the database.
  • update: update the schema.
  • create: creates the schema, destroying previous data
  • create-drop: drop the schema at the end of the session.

 

FREE WildFly Application Server - JBoss - Quarkus - Drools Tutorials