How to order records by a computed column in Criteria API?

Posted by bilalsalih on Stack Overflow See other posts from Stack Overflow or by bilalsalih
Published on 2010-04-01T11:05:02Z Indexed on 2010/04/01 11:53 UTC
Read the original article Hit count: 282

Filed under:
|
|

How can I write the below HQL query using the Criteria API?

select s.Name, sum(q.PointsObtained), sum(q.TotalPoints)
from Student s join s.Quizzes
order by sum(q.PointsObtained) / sum(q.TotalPoints) desc

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about criteria-api