facebook

[Closed] Help with hibernate templates

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

    icon911
    Member

    Hi, I am looking for a way to create or modify existing template. I would like to see a couple of things happen:

    1. I would like data access objects named *Repository rather than *DAO

    2. I would like to ommit schema and catalog properties that are added to mapping files. I think mappingxml.vm supposed to control that, however I dont see those properties in there so I am wrong 🙂

    3. And finally instead of just creating DAO (Repository) I would like to generate an interface and have its implementation. Just wondering if anyone created a template like that or, well, I gonna have to dig in to *.vm files 🙂

    Also, is there any documentation for Hibernate template creation/manipulation ?

    Thanks,
    Oleg

    #259117 Reply

    Riyad Kalla
    Member

    Oleg,
    I believe you will need to customize the templates, there is some instruction available on this, please have a look at section 5.5 in the Hibernate documentation here:
    http://www.myeclipseide.com/images/tutorials/quickstarts/hibernate/

    #259194 Reply

    Brian Fernandes
    Moderator

    Oleg,

    You have been looking at the wrong templates, please follow Riyad’s comment above to get to the right files. Here are the answers to your questions…

    1) Unfortunately the templates will not allow you to change the name of the DAO classes generated, you may only change the contents. We are looking at introducting this capability in the future.
    2) You need to edit the persistentclass.hbm.vm template to remove these attributes
    3) If you use MyEclipse 4.1.1 or 5.0.x, on the first page of the RE wizard you get an option to generate a basic DAO – the default behaviour of this DAO is to extend a base DAO class which implements a specific interface – both these will be generated for you. This should be what you need.

    Hope this helps,
    Brian.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: [Closed] Help with hibernate templates

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