• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Tool custom template

 
jacob deiter
Ranch Hand
Posts: 583
  • Mark post as helpful
  • send pies
  • 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.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What Hibernate tool are you talking about?
 
jacob deiter
Ranch Hand
Posts: 583
  • Mark post as helpful
  • send pies
  • 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

 
Nithi Rajan
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • 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
  • 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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic