I have been using hbm2ddl
and hbm2java
to build my database and POJOs for my project based on my XML mapping files (hbm.xml). I'm starting to get some real data now in the system, so re-running my ant script which drops the database and recreates everything is no longer a viable option since I want to keep the data. I have heard that there is a hbm2ddl.auto feature which can be used to modify the db structure without getting rid of the data, but I gather from some of the answers on s/o that it's not a best practice.
My understanding is that you should write the SQL DDL based on the changes in the mapping file and run it against the DB. I was wondering if hbm2ddl can be used to generate this DDL based on the mapping file. I have also head about LiquiBase, but not sure if those would be appropriate for my situation as I am hoping to keep using the hbm.xml files as the key data definition source.
Comments and suggestions are appreciated - thanks in advance!