Thanks for the fast reply Dmitry.
model.getVersion().getType() return a DateType (which is not a subclass of VersionType)
I found reference to the same problem in that forum: https://hibernate.onjira.com/browse/HBX-633. Unfortunately it appears the for Hibernate 2 there is no custom strategy class for customazing your reverse engineering strategy.
Anyway, that problem had been solved "magicaly", as usual... '¬¬ (I think I just changed the classpath for including the hbm directly instead as part of a path)
Now, even though the hbm is created with the timestamp atribute as a <version> tag instead of a <property> tag, it queries and inserts ok. I'm lost with this, but as it works meanwhile I am trying to solve the generation problem.
The hibernate-tool.jar is the one inside the plugin folder of my eclipse Helios, the same as the jars that it depends on (freemarker.jar jtidy-r8-20060801.jar). The hibernate2.jar is from the official distribution found at http://sourceforge.net/projects/hibernate/files/hibernate2/ (version 2.1.8).
My build.xml is this one:
Code:
<project name="myProyect" default="reveng" basedir=".">
<property name="entorno" value="DEV"/>
<property name="project.basedir" value="${basedir}/../../../.."/>
<property name="conf.dir" value="${basedir}/conf/${entorno}"/>
<property name="hbm.dir" value="${basedir}/entities"/>
<property name="src.dir" value="${project.basedir}/src"/>
<path id="toolslib">
<path location="${basedir}/lib/hibernate-tools.jar" />
<path location="${basedir}/lib/freemarker.jar" />
<path location="${project.basedir}/lib/hibernate2.jar" />
<path location="${project.basedir}/lib/ojdbc14_g.jar" />
</path>
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="toolslib" />
<target name="reveng">
<echo message="Entorno: ${entorno}" level="info" />
<echo message="Starting reverse engineering..." level="info" />
<hibernatetool>
<jdbcconfiguration
packagename="com.vodafone.portability.JobsPOE.persistence.generated"
revengfile="hibernate.reveng.xml" />
<hbm2hbmxml destdir="${hbm.dir}" />
</hibernatetool>
<echo message="Reverse engineering ended." level="info" />
</target>
</project>
It stills throws the java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
This class does not exists inside hibernate2.jar nor hibernate-tools.jar
The MANIFEST of the hibernate-tools.har says its the 3.4.0.CR2-SNAPSHOT version. So as I'm using hibernate2.jar I guess I am having a hibernate-hibernateTools missmatch version issue. I bet this class should be found in the hibernateX.jar. But as I must use Hibernate 2 I am trying to find older versions of Hibernate Tools but without any success.
Does anyone know where to find previous versions of hibernate-tools and theirs documentation? Or provide me with other kind of clue that could help me?
Thanks!