In my hibernate.properties file, I have been using:
Code:
hibernate.hbm2ddl.auto=create
Of the possible (update, create and create-drop) options, this seemed like the best one to use to ensure my HSQL database was started automagically. This allows me to create a sample app where users don't have to install/start the database manually.
This has been working, but it blows away the database b/w unit test methods and when I restart Tomcat. I expected this.
Tonight, I tried changing the value to "create-update" because this is the behavior I really want: create the database if it doesn't exist, update the schema if I change any mapping files, don't delete the data.
I don't know if its a miracle or what, but it works! Is this Colorado beer getting to me, or is this a hidden Hibernate feature?
I'm using Hibernate 2.1.4, Spring 1.1 RC1-dev (last night), Tomcat 5.0.27, Ant 1.6.2, Cygwin on Windows XP - powered by JDK 1.4.2.
Thanks,
Matt