我想知道如何在hibernate中制作groupby。我的代码在下面,但它不起作用请告诉我怎么做:
Session session = getSession();
Criteria c = session.createCriteria(CardLog.class);
c.add(Restrictions.ge(CARD_PUNCHING_TIME, todaysDate));
c.setProjection(Projections.groupProperty(USER_ID));
c.addOrder(Order.desc(USER_ID));
cardLogList = c.list();
System.out.println("----------------" + cardLogList);