facebook

hibernate custom templates documentation

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #245831 Reply

    Jason
    Member

    I’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

    #245843 Reply

    snpe
    Member

    you have documentation on apache velocity site

    #245852 Reply

    Riyad Kalla
    Member

    Jason,
    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 😉

    #245870 Reply

    Brian Fernandes
    Moderator

    Jason,

    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.

    #245879 Reply

    Jason
    Member

    Thanks 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

    #245884 Reply

    Brian Fernandes
    Moderator

    Jason,

    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.

    #247757 Reply

    rfabbri
    Member

    Hi,
    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

    #262554 Reply

    Simon Cevc
    Member

    Yes, it would be VERY useful to know which objects and which properties can be used.
    Pleeeeeeease!

    Thanks,
    Simon

    #276030 Reply

    angi0003
    Member

    This message has not been recovered.

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: hibernate custom templates documentation

You must be logged in to post in the forum log in