What are the steps needed to setup an in-memory DB, build the schema automatically with Hibernate's 'hbm2ddl' tool within a Junit (3) 'setUp()' using Netbeans 6.5.1 ? I'm not using Hibernate annotations - just a mapping file.
For the actual code, I want to use an on-disk database of course. [that is the Junits live a separate 'test' package]
So I think this is getting there:
- Create a standard Java Project in Netbeans 6.5.1 , add in the Hiberate library.
- Create the POJOs, hibernate.cfg and hibernate mapping file.
- Copy the cfg and mapping file to the test package.
The setup method looks like this:
protected void setUp() throws Exception {
Configuration config = new Configuration();
config.configure();
SchemaExport exporter;
exporter=new SchemaExport(config);
exporter.create(true, true);
}