简体   繁体   中英

Boostrap Data On Start-Up , Spring MVC, Hibernate

I'am working on J2EE spring Mvc Based App with hibernate And Spring Security, And I want to bootstrap some data on Start-up ( one and only one time during the app life Cycle ), I'm Using hbm2ddl to create tables after launching the application, but they are empty, so I need to add instances to the database ( Username , password ... ) So I can test my App on development mode. Thanks

If you have a file called import.sql in the root of your classpath, Hibernate will execute it on application startup.

Please note that it is a Hibernate feature and thus not portable between persistence providers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM