I am not able to generate hbm files using hbm2hbmxml task. Please help.
Here are the files/versions that i am using
Hibernate - hibernate3.jar
Hibernate Tools - hibernate-tools.jar
MySQL DB - 4.0.18
Build.xml
----------
<project name="Test" default="compile" basedir=".">
<property name="lib.dir" value="lib"/>
<property name="src.dir" value="src"/>
<property name="build.dir" value="build"/>
<path id="project.classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="clean" description="Clean the build directory">
<delete dir="${build.dir}"/>
<mkdir dir="${build.dir}"/>
</target>
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="project.classpath" />
<target name="reveng">
<hibernatetool destdir="${basedir}/src">
<jdbcconfiguration propertyfile="${basedir}/test.db.properties"/>
<hbm2hbmxml/>
<hbm2cfgxml/>
</hibernatetool>
</target>
<target name="genjava">
<hibernatetool destdir="${basedir}/src">
<configuration>
<fileset dir="${basedir}/src">
<include name="**/*.hbm.xml"/>
</fileset>
</configuration>
<hbm2java/>
</hibernatetool>
</target>
</project>
test.db.properties
--------------------
hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost:3306/testdb
hibernate.connection.username=****
I am not using a reveng.xml since its optional.
When i run the build file, this is the output that i get, only hibernate.cfg.xml file gets generated which has database configuration. No hbm files are generated.
Build output
--------------
Buildfile: build.xml
reveng:
[hibernatetool] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
[hibernatetool] 1. task: hbm2hbmxml (Generates a set of hbm.xml files)
[hibernatetool] 2. task: cfg2cfgxml (Generates hibernate.cfg.xml)
|