Sukirtha,
I created a custom dialect.
Code:
public class TestMySql5Dialect extends MySQL5Dialect {
public boolean supportsCascadeDelete(){
return true;
}
}
I change the hibernate.cfg.xml to use the custom dialect.
Code:
<property name="hibernate.dialect">com.clareity.scrub.util.TestMySql5Dialect</property>
I added this custom dialect to my toolslib path in build.xml
The class is compiled to build.classes.dir so it should be in the
classpath.
Code:
<path id="toolslib">
<pathelement location="${build.classes.dir}"/>
<fileset dir="${build.lib.dir}">
<include name="*.jar"/>
</fileset>
<pathelement location="./src"/>
<pathelement location="./conf"/>
</path>
My build.xml "ddl" target
Code:
<target name="ddl" depends="init">
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="toolslib" />
<hibernatetool destdir="src" >
<configuration configurationfile="./conf/hibernate.cfg.xml" />
<hbm2ddl export="false"
outputfilename="../conf/${ddl.name}"
drop="true"
create="true"
delimiter=";"
format="true"
haltonerror="true"
/>
</hibernatetool>
</target>
The result:
Code:
[hibernatetool] org.hibernate.HibernateException: Dialect class not found: com.clareity.scrub.util.TestMySql5Dialect
This all seems very simple, but it does not work. Is there something special about using a custom dialect? I will keep trying.
Thanks for the suggestions.
jconstantin