jQuery in Action, 2nd edition*
The moose likes Object Relational Mapping and the fly likes Where in WEB- INF will I put my hibernate DAOs? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Where in WEB- INF will I put my hibernate DAOs?" Watch "Where in WEB- INF will I put my hibernate DAOs?" New topic
Author

Where in WEB- INF will I put my hibernate DAOs?

David Silkin
Greenhorn

Joined: Jan 19, 2009
Posts: 6
Hi everyone, this is my first ever post to a coding forum; I must really like this place ... Anyway I have a bunch of classes that use hibernate to do database stuff. I would now like to have servlets referencing these DAOs but I dont how to merge the two so that the servlet can perform db operations, as they are in different directories. I hope this makes sense to someone. Thanks in advance!

David
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Sorry, it doesn´t make sense to me.

Can´t you just place the DAO classes in the classpath and import and use it in the servlet the usual way?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

You don't need to put DAOs in your web.xml. Hibernate doesn't require anything in web.xml in fact. You just need to call your DAO from your servlet and (assuming your DAOs are on your classpath) it will all just work.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
David Silkin
Greenhorn

Joined: Jan 19, 2009
Posts: 6
Thank you Paul and Bauke, as soon as I read your replies I knew how silly my post looked. I have followed disparate tutorials and sometimes it can be tricky to think outside the scope of one and apply other concepts to it. Thanks for the help, much appreciated!
RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
I think that he is not asking to make his enteries of DAO in web.xml file.

You will be having classes folder in the WEB-INF/classes , place all your DAO class files there.


If you want something you never had do something which you had never done
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Where in WEB- INF will I put my hibernate DAOs?
 
Similar Threads
Combine Hibernate with hand-coded SQL
Hibernate: @schema notation & how to generate schema from the domains?
Master DAO or many DAOs ?
DAO vs. Entity Beans
Two WARs in one EAR