I am adding the bits that were missing.
Use case:
Modify DAO names class generated by hibernate tools
Solution:
I used mvn with ant to do this.A roundabout way but its easier for those who have mvn set up.
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask">
<classpath>
<fileset dir="${basedir}/lib">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>
<target name="gen_hibernate"
description="generate hibernate classes">
<hibernatetool destdir="${basedir}/src/main/java">
<jdbcconfiguration
configurationfile="${basedir}/hibernate.cfg.xml"
packagename="com.bcbsmt.eie.framework.dto"
revengfile="${basedir}/hibernate.reveng.xml">
</jdbcconfiguration>
<hbmtemplate destdir="${basedir}/src/main/java"
templatepath="${basedir}/src/main/resources/template"
template="dao/daohome.ftl"
filepattern="{package-name}/{class-name}DAO.java">
<property key="ejb3" value="false" />
<property key="jdk5" value="true" />
</hbmtemplate>
<hbmtemplate destdir="${basedir}/src/main/java"
templatepath="${basedir}/src/main/resources/template"
template="pojo/Pojo.ftl"
filepattern="{package-name}/{class-name}.java">
<property key="ejb3" value="false" />
<property key="jdk5" value="true" />
</hbmtemplate>
</hibernatetool>
</target>
maven POM:
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
com.bcbsmt
HibernateAnnnotationSample
0.0.1-SNAPSHOT
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>install</phase>
<configuration>
<target>
<ant antfile="${basedir}/build.xml">
<target name="gen_hibernate" />
</ant>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Jars needed:
These jars should be in ${basedir}/lib folder.Versions are as per your wish
asm-1.5.3.jar
cglib-2.1_3.jar
commons-collections-20030418.083655.jar
commons-logging-1.1.1.jar
dom4j-1.6.1.jar
freemarker-2.3.8.jar
hibernate-3.3.2.jar
hibernate-annotations-3.5.6-Final.jar
hibernate-tools-3.2.4.GA.jar
jtidy-r8-20060801.jar
log4j-1.2.17.jar
slf4j-api-1.5.8.jar
slf4j-log4j12-1.5.8.jar
sqljdbc-4.0.jar