Hi there,
I am trying to customise the output of the hbm2java tool. I have found some info in chp15 of the tool quide which says to place configuration info used by hbm2java in a config.xml file.
My ant task looks like this
Code:
<hbm2java output="${src.dir}" classpathref="hibernate.classpath">
<fileset dir="${build.gen-src.dir}/">
<include name="**/*.hbm.xml"/>
</fileset>
</hbm2java>
Nothing surprising there.
In my config.xml file I have
Code:
<codegen>
<generate prefix="Base" renderer="net.sf.hibernate.tool.hbm2java.BasicRenderer"/>
<generate renderer="net.sf.hibernate.tool.hbm2java.VelocityRenderer">
<param name="generate-empty-concrete-classes">true</param>
<param name="baseclass-prefix">Base</param>
<param name="template">pojomxc.vm</param>
</generate>
</codegen>
How do I tell the ant taks to use this config file? I am pretty sure that I still need to debug the above config file as I don't fully understand how it all works but can't even get there because it is not used by the ant task. The config file is in the same directory as the hibernate.cfg.xml file and the hbm.xml files.
Another set of questions
The idea here is I want to create the default class genereated by the tool and use them as base classes for a the concrete class which I wish to override with some specific code. I need to implement comparable interface and extend another abstract class. I am trying to isolate my spefic code from the general code generated when the database changes.