| Author |
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
Bartender
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
Greenhorn
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
Greenhorn
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
Regards!
|
 |
 |
|
|
subject: Hibernate Tool custom template
|
|
|