-->
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: Does Hibernate CREATE SQL Tables if necessary?
PostPosted: Mon Oct 13, 2008 2:16 am 
Beginner
Beginner

Joined: Wed Oct 08, 2008 10:59 am
Posts: 37
As far as I can see as a new user Hibernate always
depends on EXISTING SQL tables.

So is there no feature or add-on which tells Hibernate:
"If for Java object 'myHib' no SQL table exists then create it".

Peter


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 13, 2008 4:00 am 
Newbie

Joined: Fri Oct 10, 2008 11:17 am
Posts: 9
generateDdl will create/alter tables as required. Careful!

<property name="generateDdl" value="true" />


Top
 Profile  
 
 Post subject: Re: Does Hibernate CREATE SQL Tables if necessary?
PostPosted: Mon Oct 13, 2008 12:17 pm 
Newbie

Joined: Mon Oct 06, 2008 10:30 am
Posts: 4
pstein wrote:
As far as I can see as a new user Hibernate always
depends on EXISTING SQL tables.

So is there no feature or add-on which tells Hibernate:
"If for Java object 'myHib' no SQL table exists then create it".

Peter


You can use
Code:
SchemaExport
to generate database tables from mapping files/annotated classes

http://www.hibernate.org/hib_docs/v3/api/org/hibernate/tool/hbm2ddl/SchemaExport.html


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.