-->
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: Criteria on many-to-many relation
PostPosted: Tue Dec 06, 2005 11:30 am 
Newbie

Joined: Sat Oct 22, 2005 4:17 am
Posts: 7
Hello,

i have a many-to-many relation between two classes.
Quote:
* *
[player] <----------> [group]



Now i want to search some players, bases in its name and if selected a group.

Code:
lICriteria.Add(Expression.Like("name", "the name"));
lICriteria.Add(Expression.Like("parent", aGroup));


name is the property whitch contains the name
parent is the property whitch contains a list of groups where the player is in.

But this isn't working. Is was an one-to-many relation, then did it work. But now anymore...

How can a create criterea so it searches on "related object"?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 07, 2005 11:11 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Use ICriteria.CreateCriteria.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 21, 2005 4:39 am 
Newbie

Joined: Sat Oct 22, 2005 4:17 am
Posts: 7
Well i didn't get it working with criterria :(

But i got it working with HQL.

The NHibernate help said by the SetFetchMode method:
Specify an association fetching strategy. Currently, only one-to-many and one-to-one associations are supported.


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.