-->
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.  [ 1 post ] 
Author Message
 Post subject: HibernateToolTask - hmb2ddl generates an empty file
PostPosted: Wed Feb 02, 2011 5:46 am 
Newbie

Joined: Wed Feb 02, 2011 5:26 am
Posts: 1
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.