- This topic has 2 replies, 2 voices, and was last updated 18 years, 2 months ago by gmashini.
-
AuthorPosts
-
gmashiniMemberHello all,
I was wondering if it is possible to generate custom artifacts using the ME hibernate code generation tools. I would like generate some custom Java classes to go along with my POJO’s. Also, I am also interested in having custom functions that extend some of the methods and values on the $pojo velocity object. I would like to introduce a new object in the velocity template that can be used to retrieve values and run methods that are outside the scope of the $pojo tool.
I was able to achieve this in the HibernateTools project by using the custom hbmtemplate ANT task below. I am trying to convert to ME, but I cannot find a way to do this custom generation.
<hbmtemplate
exporterclass=”com.mycompany.customexporter”
filepattern=”.”>
<property key=”hibernatetool.sometool.toolclass” value=”com.mycompany.ToolClassName”/>
</hbmtemplate>
Brian FernandesModeratorGmashini,
You can use templates to modify the files which are already being generated. (Download this file and see the instructiosn in the README.txt http://www.myeclipseide.com/products/eworkbench/public-src/myeclipse_templates_4.1.0.zip)
However, you cannot yet use something like you have specified above to generate new files in addition to existing files.
We are aware of this requirement and we will try to address this asap in the first release post GA.Sorry for the inconvenience caused and thank you for asking,
Best,
Brian.
gmashiniMemberBrian,
Sounds great, thank you for the response. I am also wondering if you have plans to move to the new FreeMarker version of the hibernate tools. I have noticed some great improvements in error handling and exception reporting with the FreeMarker release. It made troubleshooting my templates much easier.
Thanks,
gmashini
-
AuthorPosts