Hi!
I have some problem generating DDL from hibernate annotated classes using "hbm2ddl" tool (version 3.2.0).
Here is the ant task:
Code:
<target name="schema" depends="prepare" description="Exports a generated schema to DB and file">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="schema.classpath"/>
<hibernatetool destdir="db/">
<classpath path="${classes}"/>
<annotationconfiguration configurationfile="${classes}/hibernate.cfg.xml"/>
<hbm2ddl drop="true" create="true" export="true" outputfilename="helloworld-ddl.sql" delimiter=";" format="true"/>
</hibernatetool>
</target>
"${classes}" points to compiled annotated classes and "schema.classpath" has hibernate3.jar, hibernate-tools-3.2.0.ga.jar, hibernate-commons-annotations-3.1.0.GA.jar, hibernate-annotations-3.2.0.ga.jar and stuff ...
But generated "helloworld-ddl.sql" remains empty. I had checked out proper annotations in a single class file generating single table using
Code:
...
SchemaExport schema = new SchemaExport(configuration);
schema.setOutputFile(
"schema.sql");
schema.create(true, true);
in a JUnit test, and it works. Single table for class generated, but the ant task doesn't work .
Please, anybody tell me, what could be wrong?