In fact, i want to test the custom generation.
1 - i generated some hbm from hibernate ant tools.
<target name="generation_hbm" description="generation des fichiers hbm">
<hibernatetool>
<jdbcconfiguration revengfile="${generation.reveng.cfg}"
configurationfile="${generation.fichier.cfg}"/>
<hbm2hbmxml destdir="${generation.output.persistance.dir.hbm}" />
</hibernatetool>
</target>
2 - i launched the generation of dao of Hibernate Tools :
<target name="generation_dao" description="generation des dao">
<hibernatetool>
<configuration configurationfile="${generation.fichier.cfg}" >
<fileset dir="${generation.output.persistance.dir.hbm}" id="id">
<include name="**/*.hbm.xml"/>
</fileset>
</configuration>
<hbm2dao destdir="${generation.output.persistance.dir.dao}" templatepath="${generation.templates.dir}"/>
</hibernatetool>
</target>
3 - With an exact copy of "daohome.vm", i execute the task below :
<target name="generation_interface_dao" description="generation des interfaces des dao">
<hibernatetool>
<configuration configurationfile="${generation.fichier.cfg}" >
<fileset dir="${generation.output.persistance.dir.hbm}" id="id">
<include name="**/*.hbm.xml"/>
</fileset>
</configuration>
<hbmtemplate
destdir="${generation.output.persistance.dir.idao}"
template="${generation.templates.idao}"
filepattern="${generation.output.persistance.package.idao}/I{class-name}.java"/>
</hibernatetool>
</target>
------------------------------------------------------------------------
The result is :
- i have ann error other $c2j.getJavaTypeName($clazz.identifierProperty)
- if i delete theses lines, i get as one file for an hbm plus an other file is the hbm have a complex primary key (like hbm2java).
|