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!