I am new to the hibernate tools and am trying to use the ant tool hbm2java to generate the POJOs for me from my hibernate mapping file. I am getting the following error:
[hibernatetool] org.hibernate.MappingException: class robot.dao.pojo.Environment not found while looking for property: id
My mapping file is as follows:
Code:
<hibernate-mapping>
<class name="org.tiaa.robot.dao.pojo.Environment"
table="DSV_ROBOT_ENV">
<id name="id" column="ENV_ID">
<generator class="native"/>
</id>
<property name="name" column="NAME"/>
<property name="description" column="DESCRIPTION"/>
<property name="sortOrder" column="SORT"/>
</class>
</hibernate-mapping>
My Ant Task is as follows:
Code:
<target name="local.hibernate">
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask">
<classpath>
<fileset dir="${buildlib.dir}">
<include name="hibernate-tools.jar"/>
<include name="velocity-1.4.jar"/>
<include name="velocity-tools-generic-1.1.jar"/>
<include name="jtidy-r8-21122004.jar"/>
</fileset>
<fileset dir="${lib.dir}">
<include name="hibernate3.jar"/>
<include name="asm-attrs.jar"/>
<include name="asm.jar"/>
<include name="cglib-2.1.jar"/>
<include name="dom4j-1.6.jar"/>
<include name="ehcache-1.1.jar"/>
<include name="commons-collections.jar"/>
</fileset>
</classpath>
</taskdef>
<echo message="local.hibernate"/>
<mkdir dir="${src.dir}/java/robot/dao/pojo"/>
<delete>
<fileset dir="${src.dir}/java/robot/dao/pojo">
<include name="**/*.java"/>
</fileset>
</delete>
<hibernatetool destdir="${src.dir}/java">
<configuration>
<fileset dir="${docroot.dir}/WEB-INF/classes">
<include name="**/*.hbm.xml"/>
</fileset>
</configuration>
<hbm2java jdk5="false" ejb3="false"/>
</hibernatetool>
</target>
Any help would be greatly appreciated.
Thank you!