scesbron wrote:
Two points you have to check
- your hibernate.properties must be in your classpath if you want schemaexport to find it by default (it seems that for your it is in the etc folder)
- Maybe you have to give a classpath attribute to the SchemaExport task in order for it to find your classes
but if you put the hibernate.properties in the classpath, running schemaexport in a main is as easy as
Code:
new SchemaExport(new Configuration().configure()).create(true, false);
you set true in the first parameter if you want to generate a script and true for the second if you want to create the database directly
I'll try playing around with classpath more. The hibernate.properties seems to get picked up from etc when I run 'ant eg', so I'll look at that task to see if anything obvious is different.
Unfortunately, I CAN'T run schemaexport in a main to Firebird, because I have to have exclusive DB access to do some of the operations and I only seem to be able to get it from the command line. That's why I've disabled this from the example and I'm trying to save the schema off to a file in hopes of sending it manually to Firebird.
-Jeff