Hello Guys!
This SQL works for me:
select * from Question q where (select COUNT(*) from RelatedQuestion
rq where q.Id = rq.ParentId) > 1
Now I try to convert it to Criteria API:
DetachedCriteria subCriteria = DetachedCriteria.For<Question>("rq")
.CreateCriteria("RelatedQuestions").SetProjection(Projections.RowCount())
.Add(Restrictions.EqProperty("rq.ParentId", "q.Id"));
DetachedCriteria criteria =
DetachedCriteria.For<Question>("q").Add(Subqueries.Le(1,
subCriteria));
IList<Question> results = Question.FindAll(criteria);
As a result I get: "Could not find a matching criteria info provider
to: NHibernate.Impl.CriteriaImpl+Subcriteria".
Any ideas to help me out?
Regards,
Jakub
--
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.