Hi,
I have a many to many relationship between Candidates and Positions. I am trying to limit the list of positions fetched to as follows
ICriteria criteria = this.GetSession().CreateCriteria(typeof(Candidate), "c"); criteria.CreateAlias("c.Positions", "plist",NHibernate.SqlCommand.JoinType.InnerJoin); criteria.CreateAlias("plist.items", "p",NHibernate.SqlCommand.JoinType.InnerJoin); criteria.Add(Expression.And ( Expression.Eq("c.CandidateID", candidateID), Expression.Eq("p.PositionID", positionID) ));
however all the positions are being fetched in the list. What may be the reason?
Thanks
Anurag