-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Generating countQuery for queries with CTE fails with actual pagination #3726
Comments
Ah, my current workaround is to use an explicit countQuery (see below) but I'd expect Spring Data to either block the invalid JQL generation with an explaining exception or actually support this usecase :)
|
I get it too, I managed to make it work also using countProjection. |
I rechecked the "Automatic countQuery with CTE" case from #3504 and found another adjacent issue. In the other bug report I've used
Pageable.unpaged()
which apparently doesn't actually execute a count because the query itself already returns all elements. I've updated the repository with a constrained page request and now I have another exception from Hibernate not accepting the generated query:The generated countQuery is
WITH entities AS (SELECT e.id as id, e.number as number FROM TestEntity e) SELECT count(c) FROM entities c
.See again here: https://github.com/bountin/spring-data-jpa-issue-3504
The text was updated successfully, but these errors were encountered: