facebook

Customize jpa reverse engineering template in MyEclipse 5.5

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #272622 Reply

    metcalfjm
    Member

    Hi All,

    I would like to use custom templates to reverse engineer my JPA artifacts Can anyone point me to the location in the MyEclipse 5.5 installation where I can find the default template files? I’d like to use them as a starting point and then mock them up for customizations. I have been able to find many of the vm, ftl, and vtl Velocity/Freemarker template files for most of the other functional areas such as Hibernate and EJB. I have even found persistence.xml.vm, but I have not been able to find the templates for the JPA Entity, DAO, EntityManagerHelper, etc.

    Best regards,

    J. Metcalf

    #272671 Reply

    metcalfjm
    Member

    I’m surprised nobody knows where the JPA templates are located. Are the JPA artifacts just derived from the standard Hibernate tools templates using JPA specific settings? Are the JPA templates Freemarker or Velocity?

    Cheers,

    J. Metcalf

    #272679 Reply

    Loyal Water
    Member

    Hi Metcalf,
    Sorry for the delay on this one. The templates can be picked up from the hibernate quickstart at the following location under the MyEclipse installation:-
    <MyEclipse Installation Folder>\myeclipse\eclipse\plugins\com.genuitec.myeclipse.doc_5.5.0\html\quickstarts\hibernate\myeclipse_templates_5.5GA.zip

    #272682 Reply

    metcalfjm
    Member

    I found the template files in ${MY_ECLIPSE_BASE}/MyEclipse\ 5.5.1\ GA/eclipse/plugins/com.genuitec.myeclipse.doc_5.5.0/html/quickstarts/hibernate/myeclipse_templates_5.5GA.zip. These are the Velocity templates MyEclipse JPA reverse engineering is using. This helps to some extent, but it is possible that I would have to customize the logic in the Java velocity code. Is this code is the open source? I would look into the Hibernate Tools Beta 8 Java template code but I’m pretty sure that they are using Freemarker.. Unless I’m mistaken this suggests that it would not be the right code, correct? Any suggestions?

    Cheers,

    J. Metcalf

    #272683 Reply

    metcalfjm
    Member

    @support-nipun wrote:

    Hi Metcalf,
    Sorry for the delay on this one. The templates can be picked up from the hibernate quickstart at the following location under the MyEclipse installation:-
    <MyEclipse Installation Folder>\myeclipse\eclipse\plugins\com.genuitec.myeclipse.doc_5.5.0\html\quickstarts\hibernate\myeclipse_templates_5.5GA.zip

    Thanks Nipun. No problem. I just saw your reply right after I posted my question on the Java Velocity code. Do you know where I can find that Java code as well?

    Best regards,

    #272688 Reply

    Brian Fernandes
    Moderator

    Hi,

    While Hibernate Tools has been using Freemarker templates since Beta 5, we’ve continued with equivalent Velocity templates.

    If you look at the Hibernate Quickstart guide in the attached help, there is a section on customizing the RE strategy by specifying a java class with some of the logic. However, beyond that you cannot customize any of the code – even though HT is open source, there is no way in which you can re-integrate it into the ME RE process.

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

    #272691 Reply

    metcalfjm
    Member

    Thanks Brian. I’ll look back at what is being generated and it may be possible that the reveng class would satisfy my needs.

    Cheers.

    #272702 Reply

    metcalfjm
    Member

    Gents,

    What I’m finding is that when I use the custom type mappings, the reverse engineering code stops using $pojo.generateBasicAnnotation($property) in the template code to generate annotations such as @Lob @Temporal or @Basic annotations. Is there anything I can do to get those annotations to generate and if possible to customize them short of creating my own templates? I don’t recall from my experience with Hibernate tools that the reveng xml or reveng strategy class addressed annotation customization.

    Thanks,

    -J

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: Customize jpa reverse engineering template in MyEclipse 5.5

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