-->
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.  [ 4 posts ] 
Author Message
 Post subject: Hibernate Use
PostPosted: Mon May 05, 2008 10:48 am 
Newbie

Joined: Thu May 01, 2008 4:53 pm
Posts: 11
Hi Every one,

I am learning Hibernate.For this i am following tutorials form different websites.In every tutorial they gave examples for saving data or to update data.I couldn't find any examples for retrieving data(like retrieving a row depending on some condition ) .Now my doubt is,Can't we use hibernate for retrieving data form a table? If we can,how to do that ? what are different operations that we can perform with hibernate ? Can any one please tell me.

Thank q very much,
siri.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 06, 2008 2:09 am 
Senior
Senior

Joined: Mon Feb 25, 2008 1:48 am
Posts: 191
Location: India
Ofcourse we can retrieve data using hibernate.

session.load() method can be used to load a particular entity. It looks for the entity in the session first, and if the entity is not present in the session already, it retrieves it from the underlying database.

Apart from that you can use HQL to query your database. Another option is to use criteria based querying. You can also use native SQL queries to query your underlying database.

For details on how to use HQL, criteria, native SQL with hibernate, you may want to go through the hibernate documentation.

_________________
Sukirtha


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 06, 2008 7:33 am 
Newbie

Joined: Thu May 01, 2008 4:53 pm
Posts: 11
Thanks Sukirtha,
I want another help also.I can't find code examples for this topic any where.Can u please give me some examples or tell me any websites names for Hibernate tutorials with code examples.

Thanks,
siri.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 06, 2008 7:51 am 
Regular
Regular

Joined: Thu Mar 06, 2008 5:06 am
Posts: 68
siri wrote:
I want another help also.I can't find code examples for this topic any where.


Your first station should be the documentation of hibernate - here a link to the right chapter: http://www.hibernate.org/hib_docs/v3/re ... te-loading


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.