Quote:
Can someone help?
All I want is that the database will be created if it doesnt exist, and afterwards the data will not be deleted after startup.
hibernate.hbm2ddl.auto has only 3 values.
## auto schema export
#hibernate.hbm2ddl.auto create-drop
#hibernate.hbm2ddl.auto create
#hibernate.hbm2ddl.auto update
#hibernate.hbm2ddl.auto validate
The best you can do is export the database first time before running the application using ANT task or using SchemaExport while building session factory.
You can SchemaExport with ANT tasks to validate and update database.
It is always advisable to turn off hbm2ddl.auto property in Production configuration. For Dev purpose, you can use either 'validate' or 'update'.