-->
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.  [ 5 posts ] 
Author Message
 Post subject: Can we create The table with hibernate
PostPosted: Mon May 29, 2006 10:17 am 
Newbie

Joined: Wed Apr 26, 2006 6:29 am
Posts: 4
Location: India
Can we create the Table using Hibernate???


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 29, 2006 10:22 am 
Newbie

Joined: Mon May 29, 2006 6:07 am
Posts: 12
Yes, you can, all youhave to do is create your class and the mapping file and when the aplication need it, it will create the table in your database


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 29, 2006 12:38 pm 
Regular
Regular

Joined: Thu Sep 22, 2005 1:53 pm
Posts: 88
Location: Rio de Janeiro
Hi try the following in your hibernate configurations file:

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

create : Creates your schema every time your run HB
update : Creates your schema every time your run HB

etc....
I Think there is a way to only generate the ddl but you have to check Chapter 20 of the hibernate documentation for that.

Good Luck

_________________
Don´t forget to rate!


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 29, 2006 8:31 pm 
Beginner
Beginner

Joined: Sat May 20, 2006 3:40 pm
Posts: 21
If Hibernate executes the DDL against the DB whenever your application uses the class, then what is the use of hbm2ddl or SchemaExport/Update?

Don't they do the same thing?


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 30, 2006 7:35 am 
Regular
Regular

Joined: Thu Sep 22, 2005 1:53 pm
Posts: 88
Location: Rio de Janeiro
lightbulb432 wrote:
If Hibernate executes the DDL against the DB whenever your application uses the class, then what is the use of hbm2ddl or SchemaExport/Update?

Don't they do the same thing?


My Bad, update only updates your schema if nessecary....
And it does this when you call configure.... só normaly only happens
once when you run your application.

_________________
Don´t forget to rate!


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