How can I write the HQL query below using the criteria API?
select s.Name, sum(q.PointsObtained), sum(q.TotalPoints) from Student s join s.Quizzes q group by s.Name order by (sum(q.PointsObtained) / sum(q.TotalPoints)) desc
It is not supported by HQL or the Critieria API. See 14.12. Group by clause : "Neither the group by clause nor the order by clause may contain arithmetic expressions." I assume that you mean an SQL query, not an HQL query, in your question.
Source: https://habr.com/ru/post/1739451/More articles:Hibernate naturalID - hibernateIE innerHTML прерывает предложение, если последнее слово содержит '&' (амперсанд) - javascriptUnable to load libsctp.so for users without root - c ++Python - количество значимых цифр в результатах разделения - pythonWhat does the * address (found in printf) in the assembly mean? - cDefining line orientation using vertex shaders - c ++Create an instance of the exported C ++ class from Delphi - c ++How to combine multiple UIImageView into one UIImage - iphoneHow to get Eclipse to work with fragment macro in maven doxia files? - eclipsePlanning and meeting deadlines at Scrum - scrumAll Articles