-->
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.  [ 3 posts ] 
Author Message
 Post subject: New to Hibernate
PostPosted: Wed May 28, 2008 6:15 am 
Newbie

Joined: Wed May 28, 2008 6:06 am
Posts: 6
I'm reading the hibernate reference, but i had a question, which i i searched for it on the internet but i couldn't find a good answer.
Can anyone of the experts here explain to me , or refer to me a document which explain the "hbm2ddl.auto" property?


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 28, 2008 7:19 am 
Beginner
Beginner

Joined: Thu Jun 14, 2007 4:33 am
Posts: 39
im no an expert but the propertie sets how the database-schema is beeing influenced by hibernate when the sessionfactory is created and/or closed:


- if you have a working database you dont want to set this property
- if you want hibernate you export changes made in your mappin-files automatically to your existing schema (so you dont have to type the sql's on your own) you should set this property to "update". this is usefull for testing
- if you dont want to create the schema typing your sqls (lets say you have an empty database) you can set the property to "create" and hibernate will do it for you
- validate - well it validates your mapping against your existing schema
- create-drop creates the schema and drops it after the sessionfactory is closed


take a look at:
http://www.hibernate.org/hib_docs/refer ... ation.html
especially 3.7

just play around with the setting ...


Top
 Profile  
 
 Post subject: Thx
PostPosted: Wed May 28, 2008 7:45 am 
Newbie

Joined: Wed May 28, 2008 6:06 am
Posts: 6
Thanks so much for your help :-)


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