-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JPA fetchCount() and group by not working #1614
Comments
Any updates on this issue? |
Have the same, didn't fixed it in 4.1.4 |
I can also confirm this is present at least up to 3.7.4
workaround is using |
I'm also hitting this problem, using version 4.2.1. My query has multiple expressions in the |
Also still running in to this unfortunately. Has anyone found a workaround? |
Still raised same error in 4.2.1 |
Any progress in this? It's been 5 years... |
Yes, we're going to deprecate/remove it entirely for JPA: #2605 . The computation will fall back to an implementation in memory, as it simply can not be done with plain JPA. |
This is a bug resulting from this posting on Google Groups (see https://groups.google.com/forum/#!topic/querydsl/WH582YIY98I):
I found a strange problem with a rather complex group by query when it comes to counting the number of rows that will be returned for the query - the created HQL query contains a having clause (which is correct), but omits the group by clause (which is not correct and leads to an exception, stating that having was encountered without group by). I debugged the problem and found this code in JPQLSerializer.serialize():
My wish would be that a count query with group by + having would work, because I have a use case where I need exactly that. If that doesn't work out, then at least the having part should be omitted when fetchCount() is called.
Thanks in advance (for fixing this bug) and thanks for QueryDSL in general, which is truly awesome!
The text was updated successfully, but these errors were encountered: