-->
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: Drop an existing schema and create a new one dynamically
PostPosted: Mon Oct 23, 2006 8:46 am 
Newbie

Joined: Wed Oct 11, 2006 4:54 am
Posts: 5
I want to drop an existing schema (if it exist) in a MySQL database and create a new one ready for insertion.
The need is for setting up a "bacth" creation of several databases..

How can I do this in Hibernate, I have read about the SchemaExport option. But this requires me to save the generated sql to a file and then then continue from there.. there is not an option like the schemaUpdate in org.springframework.orm.hibernate3.LocalSessionFactoryBean that also created the schema if it does not exist???
Or if it of cource can be done in the code in som smart way.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 2:02 pm 
Senior
Senior

Joined: Tue Aug 23, 2005 8:52 am
Posts: 181
Checkout the hibernate.hbm2ddl.auto property and the values that it takes from the Hibernate Reference Doc. If you want a scheme created at the beginning of your test and deleted at the end, you might want to use the "create-drop" scheme.


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.