facebook

Reverse Engineering Templates Usage

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

    Frank Lawlor
    Participant

    The documentation has a VERY brief description of using reverse engineering templates. The downloaded file provides some directions on configuration of the template files but nothing more.

    When I follow the directions and point to the rev-engineering templates directory (I also selected to add a hibernate.reveng.xml file (need this?)). Previously the wizard generated my files, but after the above selections it does nothing and there are no messages!

    Clearly there is more to do here. What?

    There is alo no documentation about the language and approach used in the .vm files. From my searching I gather that these are related to Velocity, but even looking on the Apache site I couldn’t find any documentation. Where can I find some?

    By the way, my first goal was to convert DB files with a leading prefix to classes without the prefix (e.g. R_USER -> User.java). Are templates good for this or should I be looking at a “custom reverse engineering strategy”?

    Thanks

    #280881 Reply

    Brian Fernandes
    Moderator

    I’m surprised nothing is generated – can you check your Error Log for errors during generation? Also I’m assuming that you downloaded the templates from the Hibernate tutorial?

    The hibernate.reveng.xml file will be created automatically if you make any custom settings in the wizard, you don’t really need to create or add one manually, I would suggest that you delete your file and let the wizard create one if necessary just in case there was a problem here which caused the generation to stop working.

    The .vm files are written in VTL (velocity template language) – here is a good user guide from the Apache site: http://velocity.apache.org/engine/devel/user-guide.html

    By the way, my first goal was to convert DB files with a leading prefix to classes without the prefix (e.g. R_USER -> User.java). Are templates good for this or should I be looking at a “custom reverse engineering strategy”?

    The reverse engineering strategy is definitely the way to go for this one, not templates. An example of how this can be used is available in section 5.6 of the Hibernate Tutorial – you will need to override the public String tableToClassName(TableIdentifier tableIdentifier); method of the DelegatingReverseEngineeringStrategy class.

    Hope this helps, let us know if you require further assistance.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Reverse Engineering Templates Usage

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