facebook

Custom hibernate code generation

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

    gmashini
    Member

    Hello 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>

    #255788 Reply

    Brian Fernandes
    Moderator

    Gmashini,

    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.

    #255794 Reply

    gmashini
    Member

    Brian,

    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

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Custom hibernate code generation

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