create-drop
This option is only for developers and not recommend for production at any time.
It has four possible values:
- validate - makes no changes to the database
- update - update the database
- create - destroy previous data, and create new schema every time
- create-drop - the database scheme will be destroyed when SessionFactory is closed explicitly.
Code in org.hibernate.cfg.SettingFactory
String autoSchemaExport = properties.getProperty( AvailableSettings.HBM2DDL_AUTO ); if ( "validate".equals(autoSchemaExport) ) { settings.setAutoValidateSchema( true ); } if ( "update".equals(autoSchemaExport) ) { settings.setAutoUpdateSchema( true ); } if ( "create".equals(autoSchemaExport) ) { settings.setAutoCreateSchema( true ); } if ( "create-drop".equals( autoSchemaExport ) ) { settings.setAutoCreateSchema( true ); settings.setAutoDropSchema( true ); }
No comments:
Post a Comment