HQL Zwracaj nowy obiekt z zapytania

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);
Zwazel