-->
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: Hibernate Tools like "java2hbm" only available as
PostPosted: Fri Oct 31, 2008 2:49 pm 
Beginner
Beginner

Joined: Wed Oct 08, 2008 10:59 am
Posts: 37
Are Hibernate Tools like "java2hbm" or "hbm2ddl" only available as Ant tasks?

Or are there any batch scripts which allow me to do these jobs by calling
Hibernate java classes with parameter?

Peter


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 04, 2008 11:04 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

the ant task just wraps around org.hibernate.tool.hbm2ddl.SchemaExport which is part of Hibernate Core. Given you have a Configuration you can just instantiate an instance of this class and trigger the schema generation.

You can also just add the hibernate.hbm2ddl.auto property to your hibernate configuration file. Hibernate will then call the appropriate SchemaExport methods depending on which value you set for this value. Check the online doc for possible values.

--Hardy


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.