If I remember correctly, you don't actually have to deal with
projections for this. I believe the call would look like the following
(obviously you should look at using the distinct root transformer in
case you need it for some reason:
oSession.CreateCriteria<Product>("p")
.CreateAlias("p. Categories", "c", JoinType.InnerJoin)
.Add(Expression. Eq ("c.Id", iCategoryId))
.List<Product>();
-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of kelly
Sent: Monday, October 04, 2010 7:50 PM
To: nhusers
Subject: [nhusers] Projecting an entity in Criteria API
Is it possible to translate the following hql query into the Criteria
API?
select p
from Product p
inner join p.Categories c
where c.Id = :catId
please note that I am specifically selecting the product entity only.
I would imagine it would deal with Projections, but I cannot find a
projection to project out all columns for an alias.
Please help!
Kelly
--
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.
--
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.