-->
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 definitions !!!!
PostPosted: Wed May 10, 2006 10:10 am 
Newbie

Joined: Wed May 10, 2006 10:05 am
Posts: 3
Hi!
hibernate.hbm2ddl.auto have 4 possibilities :
eg. validate | update | create | create-drop

With create-drop, the database schema will be dropped when the SessionFactory is closed explicitly.

With create only drops and creates the schema when the SessionFactory is created.

With update setting is for automatic updates of schema for schema evolution. (what does it means?)

What the validate do?

from Hibernate in Action: "The DDL generated by hbm2ddl will always drop all tables and regenerate them; this is especially useful in development."
and if i dont want them to be droped?

thks!


Top
 Profile  
 
 Post subject: Re: hibernate.hbm2ddl.auto definitions !!!!
PostPosted: Wed May 10, 2006 1:23 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
orusso wrote:
Hi!
hibernate.hbm2ddl.auto have 4 possibilities :
eg. validate | update | create | create-drop

With create-drop, the database schema will be dropped when the SessionFactory is closed explicitly.

With create only drops and creates the schema when the SessionFactory is created.

With update setting is for automatic updates of schema for schema evolution. (what does it means?)


It means that Hibernate tries to keep DB schema up-to-date, i.e. creating and updating necessary objects in the DB.
Quote:
What the validate do?

from Hibernate in Action: "The DDL generated by hbm2ddl will always drop all tables and regenerate them; this is especially useful in development."
and if i dont want them to be droped?

thks!


Use 'update'


Better yet: manage database schema yourself (with appropriate DB centric tools and scripts), especially for production.

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject: Re: hibernate.hbm2ddl.auto definitions !!!!
PostPosted: Wed May 10, 2006 1:40 pm 
Newbie

Joined: Wed May 10, 2006 10:05 am
Posts: 3
kgignatyev wrote:

It means that Hibernate tries to keep DB schema up-to-date, i.e. creating and updating necessary objects in the DB.

Use 'update'
Better yet: manage database schema yourself (with appropriate DB centric tools and scripts), especially for production.


First of all, thank you for your reply!
actually the database is already ready with all the tables and objects there... there is a system working on this databese (production), and now i am "translating" it to open source tecnology. So, ill not create anything new in this databese, only use it. So, as i have understood, i even dont need to use any of these 4 option, am i right?

but, just to know, do you know what the validate do?

thks!


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 1:47 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Yes, you simply do not need to use the hbm2ddl.auto option at all.
It will also significantly speed up the startup time for your application

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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.