While i am trying to look into NHibernate.Linq code ive come to the 
question how the corresponding criteria to this query looks like. One 
solution is this:

var bar = new Bar();

session.CreateCriteria<Foo>("f")
   .CreateCriteria("f.Bars")
   .Add(Restrictions.IdEq(bar.Id))
   .List<Foo>();

But is there a way to did this without directly using the Id and let 
NHibernate use its mapping information to automatically create an id 
equals? Something like:

.Add(Rstrictions.ObjectEq(bar))

Steve

Steve Wagner schrieb:
> Yes this is how i did it now (its creates a lucky "in" query :-)) i take
> this question more on interest to avoid it in the future or looking into
> fixing it when it is a bug.
> 
> Steve
> 
> Tuna Toksoz schrieb:
>> Can't you use .Contains?
>>
>> Tuna Toksöz
>> Eternal sunshine of the open source mind.
>>
>> http://devlicio.us/blogs/tuna_toksoz
>> http://tunatoksoz.com
>> http://twitter.com/tehlike
>>
>>
>>
>>
>> On Wed, Sep 16, 2009 at 3:26 PM, Steve Wagner <[email protected]> wrote:
>>
>>> ISet<Namespace.Bar>
>>>
>>> Steve
>>>
>>> Tuna Toksoz schrieb:
>>>> What is the type of Bars?
>>>>
>>>> Tuna Toksöz
>>>> Eternal sunshine of the open source mind.
>>>>
>>>> http://devlicio.us/blogs/tuna_toksoz
>>>> http://tunatoksoz.com
>>>> http://twitter.com/tehlike
>>>>
>>>>
>>>>
>>>>
>>>> On Wed, Sep 16, 2009 at 3:13 PM, Steve Wagner <[email protected]> wrote:
>>>>
>>>>> is type of query unsupported in the current implementation or is
> 
> > 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to