📜  hql 从查询中返回新对象 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:05.132000             🧑  作者: Mango

代码示例1
return em.createQuery("select new YourClass(yourTable.yourValue, sum(yourTable.yourValueButSum)) from YourTable yourTable " +
                                "where yourTable.yourValue = :value" +
                                " group by yourTable.yourGroup" +
                                " order by yourTable.yourValue desc",
                        Yourclass.class).setParameter("value", value);