Hi guys,
I am using hibernate version 3.0 and init-db in my build.xml uses SchemaExport utility. I saw that evertime I run my init-db, it drops the exisitng table and creates a new one and so my data is lost everytime I run init-db. What I want is if the table already exists then init-db should not try to re-create by drop it first. I want it to leave the table alone if it already exists. I am not sure what option I need to set in such a case. My init-db looks something like this..
<target name="init-db" description="Creates the app database.">
<taskdef classname="org.hibernate.tool.hbm2ddl.SchemaExportTask" classpathref="project.class.path"
name="schemaexport"/>
<schemaexport delimiter=";" drop="no" output="${basedir}/sql/oracle/generated/hbSchema.sql"
config="${class.destdir}/hibernate.cfg.xml" quiet="no" text="no">
</schemaexport>
<echo message="hibernate config file found in ${class.destdir}/hibernate.cfg.xml"/>
</target>
Thank you for your help guys..
|