我有 MYSQL 查询
SELECT WEEKDAY(CreatedDate),
COUNT(CreatedDate),
CreatedDate FROM bug_List
GROUP BY
WEEKDAY(CreatedDate)
但是我在休眠中找不到 WEEKDAY 函数有没有最好的方法来解决它
在这里我尝试了 nativeSQL 但我得到了空数组对象
query=session.createSQLQuery("SELECT weekday(CreatedDate), count(CreatedDate) FROM bug_list GROUP BY WEEKDAY(CreatedDate)");
result=query.list();
Iterator resultIterator = result.iterator();
while(resultIterator.hasNext())
{
Object[] obj = (Object[]) resultIterator.next();
for (int i = 0; i < obj.length; i++) {
System.out.print(obj[i] + "\t");
}
System.out.println("");
}