• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to write custom DAO's

 
Venkat dasari
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to write custom DAO's instead of letting Hibernate Synchronizer to do this for me? Is there any solution? I know how to stop HIbernate Synchronizer from generating the DAO's but i want to know how to write that in a generic way so that i can generate my own DAO's...

Thanks a Lot in Advance...

Venkat Dasari
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, but why in the heck would you want to do that? If you are goig to use Hibernate, then I'd think you wanted to because it makes it easier for your code. If you want to write your own DAO's instead of using theirs, but use everything else, then you are over complicating things.

You can create your own DAO's and DTOs yourself, but then you are just recreating Hibernate from scratch. :shrug

Mark
 
Luigi Smith
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless you like pain (or this is an academic project), you should seek not to recreate the wheel and look to some other DAO frameworks. We didn't use HibSync DAOs either, but what we did do was let it produce the original DAOs and then turn the base classes into Spring DAOs (or iBatis DAOs). Information on either are at there respective sites. We finally used the Velocity support in HSync to create our DAOs for the particular framework we were using. This was very simple to do with Spring, btw.

Another useful project that takes a real transparent approach is: http://oness.sourceforge.net/multiproject/oness-common-model/xref/index.html.

Good luck!
Lou
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic