-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: I don't want to drop the table
PostPosted: Mon Apr 04, 2005 5:46 pm 
Newbie

Joined: Wed Mar 30, 2005 12:09 pm
Posts: 10
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..


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 05, 2005 11:01 am 
Newbie

Joined: Wed Mar 30, 2005 12:09 pm
Posts: 10
Hey,
Would somebody help me with this?? How do I tell SchemaExport not to drop the table if it is already existing or in other words to check whether the table exists and if it does then don't do anything to it..
Thanx


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.