jpql 通过子查询结果排序问题

jpql 怎么将子查询结果作为排序条件
比如 sql语句:select u.id,u.account,u.name,(select COUNT(m) from Usermessage m where m.userid=u.id and m.isreaded=0) AS aa from Memberuser u ORDER BY aa DESC
这样给他起个别名“aa”完全可以,但是这样在jpql里就不行,老是识别不了aa,jpql是通过实体类来查询的,所以我觉得order by后面必须格式为**.**才行,可这个子查询咋办

Sub-selects in FROM clause

As of EclipseLink 2.4, sub-selects are supported in the FROM clause. This requires that the database supports this functionality.

SELECT e, c.city FROM Employee e, (SELECT DISTINCT a.city FROM Address a) c WHERE e.address.city = c.city

http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Querying/Support_for_Native_Database_Functions#Sub-selects_in_FROM_clause