aspose file tools*
The moose likes Object Relational Mapping and the fly likes Hibernate Tool  custom template Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate Tool  custom template" Watch "Hibernate Tool  custom template" New topic

Hibernate Tool custom template

jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
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

Joined: Apr 14, 2004
Posts: 10336

What Hibernate tool are you talking about?

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
I used "Hibernate Tools for Eclipse" Version:3.2.4 Beta

for more information I add this

My expected code

Nithi Rajan

Joined: Oct 30, 2005
Posts: 29
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

Joined: Oct 30, 2005
Posts: 29
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

I agree. Here's the link:
subject: Hibernate Tool custom template
Similar Threads
Caching Issues with Hibnernate
hibernate update in single transcation
many side of one to many not being populated
Hibernate/Mysql - previous record(s) not being persisted.
java.lang.NoClassDefFoundError: org/hibernate/criterion/Criterion