JPQL dziwny problem w zapytaniu

0

Gdy tworze Query w JPQL:

Select A.id, A.name, A.lastname, Count(B.a) from B b join A a where... group by ( A.id, A.name, A.lastname);

to jest wszystko ok, ale dlaczego nie moge zrobic po prostu tak:

Select A, Count(B.a) from B b join A a where... group by ( A.id);

aby odebrać cały obiekt A, a nie poszczegolne elementy, jak to osiagnac ?

0

Czy działa:
Select A, Count(B.a) from B b join A a where... group by A
(group by A zamiast group by A.id)
?

http://docs.oracle.com/html/E24396_01/ejb3_langref.html#ejb3_langref_group

Grouping by an entity is permitted. In this case, the entity must contain no serialized state fields or lob-valued state fields.

Niestety w Hibernate to chyba nie działa:
https://hibernate.onjira.com/browse/HHH-1615

1 użytkowników online, w tym zalogowanych: 0, gości: 1