If I Understood u well, I think that this is the way:
IList<Parent> list =
session.CreateCriteria<Parent>().CreateAlias("Children","children").
(Restrictions.Eq("childer.Gender", "male")).SetResultTransformer(new
DistinctRootEntityResultTransformer()).List<list>();
And Children in CreateAlias is your collection from Parent...
On 21 јан, 23:50, Neo <[email protected]> wrote:
> Hi,
>
> I'm trying to catch up with the Criteria API and can't seem to figure
> out how do the following HQL query using the Criteria API:
>
> "select p from Parent p left join p.Children c where c.gender =
> 'male'"
>
> and my problem is the "select p" part, can't figure out how to do this
> with Criteria without also fetching the children.
>
> Cheers!
--
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.