Hibernate version:
3.2.5g
I have an application that use spring to initiate two data sources, one external DB and one embedded DB (Derby) and mapping files external.hbm.xml and embedded.hbm.xml. (Since I'm using spring, I don't have a hibernate.cfg.xml file) For my development, hbm2ddl=create-drop works great for this setup. For production though, the DB should be created only once and data should be retained. To my surprise, hbm2ddl=create will also drop the table content as well. So I am thinking to generate schema using an ant script, which would be executed on external DB before the application starts. The embedded DB on the other hand, it should not require any user setup so I don't think generating schema would be a good idea. So I am wondering if there is any other tools or settings I could use to generate/create table for just once and still retain the data?
Regards,
|