In this approach, most of the work is actually done by the Hibernate library and we merely set up the appropriate configurations and create conventionally expected files that are needed for Hibernate to do the work:
- The spring.jpa.hibernate.ddl-auto=create-drop setting instructs Hibernate to use the @Entity models and, based on their structure, automatically deduces the database schema. Upon starting the application, the calculated schema will be used to preinitialize the database table structure; when the application is shut down, it will all be destroyed. Even in the event that the application was forcefully terminated or it abruptly crashed, upon startup, if the existing tables are ...