- This topic has 8 replies, 7 voices, and was last updated 17 years, 1 month ago by angi0003.
-
AuthorPosts
-
JasonMemberI’m curious if there is any documentation for using custom templates in the hibernate mapping wizard. I assume the templates are velocity templates. My goal was to possibly create some additional classes or html using custom templates. Is there a very simple Hello World example available? Do you simply drop .vm files in a directory and MyEclipse will pick those up automatically and generate the files or am I way off target?
Thanks,
Jason
snpeMemberyou have documentation on apache velocity site
Riyad KallaMemberJason,
There is no documentation for this. I believe you are correct the templates are velocity based (you can search for *.vm if you like from MyEclipse root), but we don’t officially support modification of the templates at this time (but if you know what you are doing, dig in 😉
Brian FernandesModeratorJason,
You can have a look at my last post in this thread https://www.genuitec.com/forums/topic/mapping-with-catalog-attribute/#post-245578 for some information about templates and how to use them.
Yes, they are velocity templates, but currently you cannot add your own templates to be processed. You are free to edit any of the templates that the RE process uses.
We plan to extend and enhance template support in future releases, we will keep your use case in mind.
Let us know if you require further assistance,Best,
Brian.
JasonMemberThanks Brian and Riyad,
I understand now. I loved how the hibernate tool automatically generated all the classes and xml files. So I was thinking wouldn’t it be great if it would continue on and create additional servlets/jsp/etc. to be able to make a complete jsp frontend for a database table with just a couple of clicks. The user would have complete control because he would create the templates. I’m very new to velocity so I’m sure this is much harder than it sounds. I know you guys have alot going on as well.
Your support is great. Keep up the hard work.
Thanks,
Jason
Brian FernandesModeratorJason,
So I was thinking wouldn’t it be great if it would continue on and create additional servlets/jsp/etc.
We’re on the same page here.
Velocity isn’t all that difficult, you could pick up enough to get you started in an hour perhaps. http://jakarta.apache.org/velocity/docs/vtl-reference-guide.html should give you a better understanding of the template language.
Of course, currenty you can only modify our templates you can’t add new files.Thank you for your compliments, we are looking at extending the template capabilities in upcoming releases – while it won’t make 4.1.1, we might have something for the release after that.
Best regards,
Brian.
rfabbriMemberHi,
I would like to customize the velocity templates used to generate hibernate files, but I need to know which are the properties and methods that I can use inside a template.In other word when I see this line
<column name=”$column.quotedName” $c2h.columnAttributes($column)/>
I’m asking you if there are some reference (Javadoc?) about these types ($c2h, etc).
Thanks
Rob
Simon CevcMemberYes, it would be VERY useful to know which objects and which properties can be used.
Pleeeeeeease!Thanks,
Simon
angi0003MemberThis message has not been recovered.
-
AuthorPosts