-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Confirmation of Hibernate Data
PostPosted: Fri Jan 09, 2009 8:56 am 
Newbie

Joined: Fri Jan 09, 2009 8:50 am
Posts: 5
Location: Bangalore
hai i am using hibernate with my project and i have put the hibernate code in my DAO layer of my struts app my query is

is it better approach to put the hibernate code in the DAO layer ?
how can i make sure in java program that particular data is inserted or not in my database ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 09, 2009 12:18 pm 
Beginner
Beginner

Joined: Thu Oct 04, 2007 12:22 pm
Posts: 48
Quote:
hai i am using hibernate with my project and i have put the hibernate code in my DAO layer of my struts app my query is


should there be a query snippet following?

I dont't know if I get you question right but in general, sure it is correct to put hibernate code into the DAO layer. A very handy approach how to separate DAO components into database dependend and independent code is given in the tutorial (or more verbose in the hibernate book):

http://www.hibernate.org/328.html

If you need a set of data inserted into DB at startup you can consider classes storing some plain files (CSV, XML whatever) via DAO into DB or more elegant use a framework. E.g. DBUnit offers a simple tool for exporting and importing data. [/url]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.