Last active
April 6, 2017 04:25
-
-
Save thjanssen/a891b9478ed528a387e6ddfcef5af06d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Query q = em.createQuery("SELECT a, size(a.books) FROM Author a GROUP BY a.id"); | |
List<Object[]> results = q.getResultList(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
05:47:23,682 DEBUG [org.hibernate.SQL] - | |
select | |
author0_.id as col_0_0_, | |
count(books1_.authorId) as col_1_0_, | |
author0_.id as id1_0_, | |
author0_.firstName as firstNam2_0_, | |
author0_.lastName as lastName3_0_, | |
author0_.version as version4_0_ | |
from | |
Author author0_ cross | |
join | |
BookAuthor books1_ | |
where | |
author0_.id=books1_.authorId | |
group by | |
author0_.id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment