-->
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: Hibernate DDL problem ?
PostPosted: Sat Oct 22, 2005 6:17 am 
Regular
Regular

Joined: Tue Nov 04, 2003 12:37 pm
Posts: 57
Hello,

In the hibernate.cfg.xml, I have a property as following:

Code:
<property name="hibernate.hbm2ddl.auto">create</property>




If I use this property "create", it will drop and create the schema automaitc. I wonder is there any bug in this version, since it should not drop and re-create if I set the property to "create". As I read the document, the property "create-drop" will be drop and create the schema.

How can I just create or update the schema if not existed or updated ?

I am using Hibernate-3.1-rc2 and Annotation-beta6 in Tomcat5 + jdk1.5._05.

Anyway, is there any tools to export the DDL and DML if I using Annotation ?

Eric


Top
 Profile  
 
 Post subject: Re: Hibernate DDL problem ?
PostPosted: Sat Oct 22, 2005 7:01 am 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
I believe the only difference between create and create-drop is WHEN the tables get dropped. With create-drop, the tables are dropped on SessionFactory close.

If you don't want them dropped, use "update" or remove the property completely after the initial creation.

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


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.