-->
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: Problem with bag and the where clause
PostPosted: Tue May 22, 2007 10:10 am 
Newbie

Joined: Tue May 22, 2007 10:02 am
Posts: 7
Hi All
I have 2 mapping files A anb B.
In A i have a bag that maps to B.
In my function i'm trying to use the Expression.Eq for a value that exists in the bag (B maping file).
Any help!!!!!!!!!!!!!!!!!!!!


Top
 Profile  
 
 Post subject: Re: Problem with bag and the where clause
PostPosted: Tue May 22, 2007 3:39 pm 
Expert
Expert

Joined: Fri May 13, 2005 11:13 am
Posts: 292
Location: Rochester, NY
See section 12.4 of the NHibernate Reference. This will probably work for you:

Code:
s.CreateCriteria( typeof( A ) )
   .CreateCriteria( "Bag_of_Bs" )
   .Add( Expression.Eq( "value_in_B", value ) );


Top
 Profile  
 
 Post subject: Re: Problem with bag and the where clause
PostPosted: Wed May 23, 2007 5:16 am 
Newbie

Joined: Tue May 22, 2007 10:02 am
Posts: 7
Thanks!!!!

I need also a sample of how to insert data from a web form using NHibernate.
Can you send me a link please


Top
 Profile  
 
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.