-->
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: How avoid to create every time DB
PostPosted: Sat Jun 17, 2006 4:34 am 
Newbie

Joined: Wed May 24, 2006 5:47 pm
Posts: 14
Hi all. I'm newbie in hibernate. I'm using the Hibernate tools in order to create DB from my mapping files. In the hibernate.cfg.xml file i have inserted this tag:

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


Well it seems to me that every time i start my application the tables are created even if they are already present. I'ld like to avoid this....how can i configure the tool in order to avoid this feature?

I'm using hibernate 3 on a project and hibernate 2.1.8 on another project. My environament is:

HIBERNATE 3 PROJECT:
JVM 1.5
LINUX RED/HAT ADVANCED SERVER
WINDOWS XP PROFESSIONAL
JBOSS 4.0
SIMPLE STAND-ALONE TEST PROGRAM


HIBERNATE 2.1.8 PROJECT:
JVM 1.4.10
LINUX RED/HAT ADVANCED SERVER
WINDOWS XP PROFESSIONAL
JBOSS 3.2.6
SIMPLE STAND-ALONE TEST PROGRAM


Thanks to all.
Angelo


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 18, 2006 4:46 pm 
Newbie

Joined: Thu Feb 16, 2006 2:05 pm
Posts: 10
Location: Nürnberg, Germany
You can comment the tag out (as it is not mandatory) like this...

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


... or you can set the value to validate (in hibernate 3)

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


Then hibernate won't create the tables at start, but will validate that your configuration fits to your tables.

_________________
Please rate this post, if it helped you.


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.