Spring+Hibernate mysql dataBase initialized with sample data
问题 I want to deploy a Spring-mvc + Hibernate project, and I want: create all database schemas automatically for the first lauch update a schema if attributes are added. add some records in some tables, a root user for USER,ect. If hibernate.hbm2ddl.auto is set to "create" , I will lost previous data every time I restart the project. If set to "update" , my import.sql where i put sql to create sample records, won't be executed. So, what's the best pactice in a "product" environment? 回答1: