------解决方案--------------------
from A order by time desc
如果按日期筛选: String hql = "from A where time >= ? order by time desc";// 切莫把变量拼接,要用占位符 Query query = session.createQuery(hql); query.setParameter(0, time);// time变量的类型必须是java.sql.Date return query.list();