-->
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: Can Hibernate Tools generate sequences?
PostPosted: Thu Jun 04, 2009 6:33 pm 
Regular
Regular

Joined: Tue Jul 29, 2008 4:15 pm
Posts: 62
Location: Dallas, TX US
Hello to all,

I am using TDD on my project and I am trying to have all my DAO test run in a in-memory database like Derby or HSQLDB. I want Hibernate to automatically export my schema into the configured database when the SessionFactory is created. Hibernate does this by the Hibernate mapping documents via the hibernate.hbm2ddl.auto=create-drop property.

My question is if Hibernate is creating and dropping the database everytime the SessionFactory is created and closed, will Hibernate create the all the sequences for all the primary keys in the tables? Can I specify this in the hbm.properties file?

Is it as simple as this:
Code:
<class name="Person">
  <meta attribute="class-description">
     Javadoc for the Person class
     @author Frodo
  </meta>
  <meta attribute="implements">IAuditable</meta>
  <id name="id" type="long">
    <meta attribute="scope-set">protected</meta>
    <generator class="native"/>
  </id>
  <property name="name" type="string">
    <meta attribute="field-description">The name of the person</meta>
  </property>
</class>


Thanks in advance!

_________________
pouncilt


Top
 Profile  
 
 Post subject: Re: Can Hibernate Tools generate sequences?
PostPosted: Sat Jun 06, 2009 1:37 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
No, it is assumed the sequences used already exists.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: Can Hibernate Tools generate sequences?
PostPosted: Mon Jun 08, 2009 10:03 am 
Regular
Regular

Joined: Tue Jul 29, 2008 4:15 pm
Posts: 62
Location: Dallas, TX US
Oh, Okay.

Thanks!

_________________
pouncilt


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.