avg(String propertyName)
引數說明:Criteria criteria = session.createCriteria(ResultForm.class); //定義Criteria物件 criteria.setProjection(Projections.avg("achievement")); //計算achievement列的平均值 double avg = (Double)criteria.uniqueResult(); //獲取計算結果 System.out.println("平均成績:"+avg);