-->
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: How to retrieve a list via a list of ids
PostPosted: Fri Mar 26, 2010 10:10 am 
Newbie

Joined: Thu Mar 25, 2010 7:55 am
Posts: 8
Hi!

If I have a list of ids, what is the best way to retrieve all objects of a certain class with those ids?

I dont like the idea of iterating through the list and creating an endless "or id=?" query.

Surely there are more elegant solutions?


Thanks a lot,
CC


Top
 Profile  
 
 Post subject: Re: How to retrieve a list via a list of ids
PostPosted: Sun Mar 28, 2010 9:24 am 
Newbie

Joined: Sun Mar 28, 2010 8:41 am
Posts: 4
Hi,

Considering HQL query :
select avo from AVO avo where avo.id in ('4','5,'6');

For Detached Criteria set Restrictions

Regards
Sidharth Sharma


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.