-->
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: question: Basics
PostPosted: Fri Jan 27, 2006 11:30 am 
Newbie

Joined: Fri Jan 27, 2006 11:14 am
Posts: 12
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hi, i am a new hibernate fan and just started learning hibernate. i got a question regarding very basic things:

I m trying to understand Configuration.setProperty(String, String) method,
and came across the class Environment.HBM2DDL_AUTO. now its value has 3 options: "create" "update" "create-drop" what does each mean and do?

i think if passing value "create" it asks program to create schema according to mapping config files everytime the program runs, is this true?

also, how exactly does HQL autocreates tables instead of SQL on-the-fly? i was told that i need to drop all tables (with duplicate names) before running hibernate code, cuz hibernate uses HQL to create tables according to mapping files? then for example i have a main.java file which uses hibernate, i think it is wrong to think that main.java re-creates schema everytime it is executed. but how should i understand this?

thanks for help!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 12:55 pm 
Expert
Expert

Joined: Tue Nov 23, 2004 7:00 pm
Posts: 570
Location: mostly Frankfurt Germany
create recreates after each new intialisation of Hibernate
update drop + create when a table has changed.
create-drop = create at the begging of the factory, drop at the end of the factory.

Yes, this should be not in your application in a life system. It is for development purpose.

Regards Sebastian

_________________
Best Regards
Sebastian
---
Training for Hibernate and Java Persistence
Tutorials for Hibernate, Spring, EJB, JSF...
eBook: Hibernate 3 - DeveloperGuide
Paper book: Hibernate 3 - Das Praxisbuch
http://www.laliluna.de


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.