-->
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: Retrieving all records of a table.
PostPosted: Thu Mar 08, 2007 12:43 am 
Newbie

Joined: Mon Jan 30, 2006 5:24 am
Posts: 2
Hi,
I am using Hibernate 3.2.2.
I want retrieve all the records of a table one by one. I don't know the primary key since it is auto generated.

What should I do?

Thanks
Tushar


Top
 Profile  
 
 Post subject: Re: Retrieving all records of a table.
PostPosted: Thu Mar 08, 2007 10:49 am 
Newbie

Joined: Wed Mar 07, 2007 2:36 pm
Posts: 5
tusharice wrote:
I want retrieve all the records of a table one by one. I don't know the primary key since it is auto generated.



Maybe I didn't understand your question.

Using Criteria:

Code:
Criteria criteria = session.createCriteria(YourClass.class);
List list = criteria.list();


This code will retrieve all the persistent instances of the class YourClass. Is it helpful?

Best Regards,

_________________
IGOR BRITO ALVES
bonfarj@gmail.com
Cultura Nerd


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.