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.  [ 4 posts ] 
Author Message
 Post subject: hibernate.hbm2ddl.auto
PostPosted: Mon Aug 28, 2006 12:12 pm 
Newbie

Joined: Mon Aug 28, 2006 10:02 am
Posts: 1
Hello, guys...

I'm pretty new to Nhibernate, and I'm having problems with the hibernate.hbm2ddl.auto parameter in the configuration XML.

I'm bulding a CRUD generator based on POCOs, to speed up my team development, and that includes creating a dynamic hbm.xml file and database stuff. The hbm.xml is running well, but the oracle stuff is driving me nuts. I set up the hibernate.hbm2ddl.auto property as "create", so if a table doesn't exists, hibernate creates it for me. But I'm having problems with the data and the generator. Why the generator is re-set everytime the applications starts? Why the data is droped in every application start? I thought it just happened if the hibernate.hbm2ddl.auto is set as "create-drop".

Anybody know why is this happening? What workaround should I do?

Thankfully..
Luiz Cavalcanti


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 14, 2007 8:56 pm 
Newbie

Joined: Thu Jun 14, 2007 8:48 pm
Posts: 2
I'm having the same problem, hibernate.hbm2ddl.auto is set to 'create' and everytime i restart the application all the data in the db disappears. Is this actually what it is supposed to do? Is there a way to make it do nothing if the tables are already generated?.. thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 15, 2007 5:34 pm 
Newbie

Joined: Fri Jun 15, 2007 3:05 pm
Posts: 1
The configuration is documented at:
http://www.hibernate.org/hib_docs/v3/re ... ation.html

the value
Code:
hibernate.hbm2ddl.auto=update
creates the tables only if they are missing.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 15, 2007 9:33 pm 
Newbie

Joined: Thu Jun 14, 2007 8:48 pm
Posts: 2
i'm not sure.. but i think nh does not implement schema update.. only create and create-drop


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.