-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Count query removes distinct
phrase if from part of JPA query contains newline character
#2341
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
Milestone
Comments
This might also be the case in #2177 |
DiegoKrupitza
added a commit
to DiegoKrupitza/spring-data-jpa
that referenced
this issue
Dec 17, 2021
The `COUNT_MATCH` did not consider line breaks after the `from` clause or the `where` clause. This lead to a no match scenario in the construction of the count query. With the fix we now consider line breaks/whitespaces after the `from` and `where` clause. Closes spring-projects#2341 Related tickets spring-projects#2177
3 tasks
Please have a look #2177 (comment) |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
It seems that there is newline character after the entity alias name in
FROM
part of the query before theJOIN
the distinct is removed from the count.Incorrect behavior:
returns
Correct behaviour:
returns
From testing if the
FROM
andJOIN
are in the same line, andWHERE
is new line then this incorrect behavior also occurs.For now I have solved it with
countProjection = "distinct entity1"
.The text was updated successfully, but these errors were encountered: