Hibernate HQL 分组求和查询

list=this.queryDao.getSessionFactory().getCurrentSession().createCriteria(SalesSlipline.class)
                        .add(Restrictions.eq("salesslipid.id",returnList.get(i).getId()))
                        .setProjection(Projections.projectionList().
                            add(Projections.sum("amount")).
                            add(Projections.sum("sum")).                           
                            add(Projections.groupProperty("salesslipid.id"))).list();

你可能感兴趣的:(Hibernate,list)