I am able to reverse engineer classes (domain classes) using the tools in STS-3.7.0 (Spring Tool Suite. built on top of Eclipse Mars), however when I try to use custom templates they do not appear to work, I get the normal generated class. I put my modified templates into all hibernate-tools-4.3.1.Final.jar files I find in my STS installation. There is one in the configuration folder and one in the plugins folder, I modify both. When I run the reverse engineering process again and I see the desired changes I made. To get my modified templates I copied all files found in the pojo folder in that jar file and modified the 4 templates I needed to get the results I was looking for. This would be acceptable for me to continue with, however if I have to start Eclipse with a "-clean" switch, the jar file in the configuration folder gets dumped and the new one that is copied back in contains the original unmodified templates. Any subsequent reverse engineering run produces results that do not contain the modifications I am looking for.
Is there a trick to getting the custom template override to work? On the "Hibernate Code Generation Configuration", I check the checkbox for "Use custom templates (for custom file generation)" and enter a path in the "Template directory:" field by selecting the "Workspace" button and drilling down the the folder I put the templates in, inside my project. That placed "\SQL Server 2008\src\main\resources\templates" in the field. Did I do something wrong?
Or, is there a way to get the templates in the jar files updated locally such that starting STS with the "-clean" switch will bring in jar files that have already been updated with my modifications?
|