Hello, I am having troubles with generating database schema with Hibernate Tools. This is my ant file
<project name="Schema generator for MySQL database" basedir=".">
<description>
This file is used for running Hibernate Tools Ant task.
It is used to generate database schema based on hibernate configuration
</description>
<path id="toolslib">
<path location="lib/hibernate-tools.jar" />
<path location="lib/hibernate-3.2.4.ga.jar" />
<path location="lib/freemarker.jar" />
<path location="lib/mysql-connector-java-5.1.13" />
<path location="lib/dom4j-1.6.1.jar" />
<path location="hibernate_mappings/Address.hbm.xml" />
</path>
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="toolslib" />
<hibernatetool destdir="${build.dir}/generated">
<classpath>
<path location="${build.dir}/classes" />
</classpath>
<configuration configurationfile="hibernate.cfg.xml" />
<hbm2ddl />
<hbm2dao />
</hibernatetool>
</project>
I get this error when running ant task:
C:\work\gwt_workspace\billing-cms\dao\src\main\resources\build.xml:19: org.hibernate.MappingNotFoundException: resource: hibernate_mappings/Address.hbm.xml not found
My filesystem path hierarchy is like this:
+resources
-hibernate_mappings
-Address.hbm.xml
-User.hbm.xml
-etc..
-hibernate.cfg.xml
-build.xml
I have my mappings defined inside hibernate.hbm.xml like this:
<mapping resource="hibernate_mappings/Address.hbm.xml" />