-->
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.  [ 1 post ] 
Author Message
 Post subject: Create a table in Junit
PostPosted: Tue Jun 08, 2010 11:18 am 
Newbie

Joined: Tue Jun 08, 2010 11:02 am
Posts: 5
Hi Guys,

i'm new to Hibernate (both forum and technology). I search for these terms and in doc but was unable to find how to do this :

I have set my Hibernate configuration, *.hbm.xml file and Junit test on these files. My tests run ok. I use setUp and tearDown to insert and remove data from my database Test.
But what I want to do is to create the structure of my database in the setUp method. So I can generate a clean structure each time I run the tests
I found how to set the conf file with <property name="hibernate.hbm2ddl.auto">create</property> but it isn't good because I can't include that in a transaction.

is there any method to use in Hibernate in order to create whole structure according to the conf files ?

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.