• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate Tool custom template

 
Ranch Hand
Posts: 594
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I Hibernate Tool, I Used it to generate DAO. But it contain session factory creation and all.

part of the code

My expectation is to use Spring Template instead of Session factory. For that ,I have to write a Template? if yes, please Help in this.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What Hibernate tool are you talking about?
 
jacob deiter
Ranch Hand
Posts: 594
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I used "Hibernate Tools for Eclipse" Version:3.2.4 Beta

for more information I add this

My expected code

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi jacob,

Did you manage to find any solution for this?

OR Are there any other opensource tools available in the market that can do this?

Thanks & Regards!
 
Nithi Rajan
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If in case it might be useful to some one, the solution for the above is as follows

1. Open the hibernate-tools.jar file in the dir c:\eclipse\plugins\org.hibernate.eclipse_3.4.1.v20110729-2006-H171-Final\lib\tools where c:\eclipse is the dir where eclipse is installed

2. inside the hibernate-tools.jar there is a file called daohome.ftl in the dir dao, which is the template for the DAO file generated.

3. Modify the file daohome.ftl [to use hibernate template OR the way you want] and update the hibernate-tools.jar and generate the classes

Regards!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic