Skip to content
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

Ignore offset for Limit based query #3454

Closed
wants to merge 1 commit into from

Conversation

quaff
Copy link
Contributor

@quaff quaff commented Apr 28, 2024

Avoid calling Query.setFirstResult(0) which maybe generated sql contains unwanted offset 0.

Fix GH-3242

Avoid calling `Query.setFirstResult(0)` which maybe generated sql contains unwanted `offset 0`.

Fix spring-projectsGH-3242
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 28, 2024
@quaff
Copy link
Contributor Author

quaff commented Apr 28, 2024

It's not likely that Hibernate will merge proposed PR linked to https://hibernate.atlassian.net/browse/HHH-17475, I think it's better to adapt at Spring Data JPA side.

@mp911de mp911de assigned mp911de and unassigned christophstrobl Jun 27, 2024
@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 27, 2024
@mp911de mp911de added this to the 3.2.8 (2023.1.8) milestone Jun 27, 2024
mp911de pushed a commit that referenced this pull request Jun 27, 2024
Avoid calling `Query.setFirstResult(0)` which maybe generated sql contains unwanted `offset 0` when using query methods accepting `Limit` .

Closes #3242
Original pull request: #3454
mp911de added a commit that referenced this pull request Jun 27, 2024
Skip Query.setFirstResult(…) if the pagable offset is not zero.

See #3242
Original pull request: #3454
mp911de pushed a commit that referenced this pull request Jun 27, 2024
Avoid calling `Query.setFirstResult(0)` which maybe generated sql contains unwanted `offset 0` when using query methods accepting `Limit` .

Closes #3242
Original pull request: #3454
mp911de added a commit that referenced this pull request Jun 27, 2024
Skip Query.setFirstResult(…) if the pagable offset is not zero.

See #3242
Original pull request: #3454
mp911de pushed a commit that referenced this pull request Jun 27, 2024
Avoid calling `Query.setFirstResult(0)` which maybe generated sql contains unwanted `offset 0` when using query methods accepting `Limit` .

Closes #3242
Original pull request: #3454
mp911de added a commit that referenced this pull request Jun 27, 2024
Skip Query.setFirstResult(…) if the pagable offset is not zero.

See #3242
Original pull request: #3454
@mp911de
Copy link
Member

mp911de commented Jun 27, 2024

Thank you for your contribution. That's merged, polished, and backported now.

@mp911de mp911de closed this Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redundant parameter in the Limit query
4 participants