-->
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.  [ 3 posts ] 
Author Message
 Post subject: Select multiple objects by Id
PostPosted: Thu Sep 01, 2005 7:17 pm 
I have a stored procedure that returns a list of object ids for a specific type. Is there any way to issue one query with NHibernate to return the objects matching the Id's returned by the stored procedure?

For example say that the sproc returns Ids 5, 7, 8, 22, and 56 for type of Employee. Now I need to get a collection of employees that match the same ids.

Thanks for any help.


Top
  
 
 Post subject:
PostPosted: Fri Sep 02, 2005 6:04 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
You can try:
Code:
from Employee e where e.ID in (5, 7, 8, 22, 56)


I don't know the exact syntax...

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 05, 2005 10:34 pm 
thanks. Seems like it should work.


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