Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ant-SchemaExportTask

 
Michael Fischer-Dederra
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i`m trying to generate my Database-Tables through following ant-Task:

<target name="db-init"
depends="clean,init,compile"
description="creates database tables">
<mkdir dir="${conf.dir}/hibernate"/>
<taskdef name="schemaexport"
classname="org.hibernate.tool.hbm2ddl.SchemaExportTask"
classpathref="lib.classpath" />
<schemaexport config="${basedir}/hibernate.cfg.xml"
quiet="no"
text="no"
drop="no"
delimiter=";"
output="${build.dir}/schema-export.sql"/>
</target>

The ExportTask recognizes my hibernate.cfg.xml, but does not find my mapping -files.
"Schema text failed: Resource: src/java/de/hibertest/Company.hbm not found"

But the file is there and the corresponding Mapping is generated through Hibernate Synchronizer (should be ok then i suppose?!).
"<mapping resource="src/java/de/hibertest/Company.hbm.xml" />"

When i`m using the "properties"-option instead of "config" ...
<schemaexport properties="${basedir}/hibernate.properties"
quiet="no"
text="no"
drop="no"
delimiter=";"
output="${build.dir}/schema-export.sql">
<fileset dir="${src.dir}">
<include name="**/*.hbm.xml" />
</fileset>
</schemaexport>
... everything works fine.

But i want to specify the mappings in the xml-file and use option 1.
Any suggestions?

Thanks a lot

Michael
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic