Skip to content

Conversation

pmh5574
Copy link
Contributor

@pmh5574 pmh5574 commented Aug 26, 2025

This PR addresses GH-3990 by adding a regression test and refining the JPQL used for deleteAllByIdInBatch.

Background

EclipseLink can fail when the JPQL DELETE uses an unqualified state field in the WHERE clause. Qualifying the field with the range variable alias makes the query portable.

Changes

  • Qualify the delete-by-id JPQL:
    delete from %s x where x.%s in :ids
  • Add EclipseLinkDeleteAllByIdInBatchSimpleIdTests:
    • Save 3 users and flush to allocate IDs
    • Delete two using deleteAllByIdInBatch
    • Assert the remaining entity is the expected one

Verification

Built and tested locally with ./mvnw clean install (JDK 17+).

Closes #3990

…ByIdInBatch with simple id.

- Save 3 users and flush to allocate IDs.
- Delete two using deleteAllByIdInBatch.
- Assert the remaining entity is the expected one.

Closes spring-projects#3990

Signed-off-by: Minho Park <[email protected]>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 26, 2025
@mp911de mp911de self-assigned this Aug 26, 2025
@mp911de mp911de added the has: ai-slop An bloated issue that contains low-value AI-generated content. label Aug 26, 2025
@mp911de mp911de changed the title GH-3990: Qualify deleteAllByIdInBatch JPQL and add EclipseLink regression test Qualify identifier used indeleteAllByIdInBatch JPQL Aug 26, 2025
@mp911de mp911de added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 26, 2025
@mp911de mp911de changed the title Qualify identifier used indeleteAllByIdInBatch JPQL Qualify identifier used in SimpleJpaRepository.deleteAllByIdInBatch(…) JPQL Aug 26, 2025
@mp911de mp911de added this to the 3.4.10 (2024.1.10) milestone Aug 26, 2025
@mp911de
Copy link
Member

mp911de commented Aug 26, 2025

Thank you for your contribution. That's merged, polished, and backported now. Please review properly AI-generated contributions. In this case, we have already a better place for the tests in EclipseLinkJpaRepositoryTests that also indicate that there has been some effort to handle batch deletes. Also, the commit message is just noise and doesn't explain what the commit is supposed to achieve, merely a duplication by summarizing changes textually. Therefore, we've rewritten the commit message.

@mp911de mp911de closed this Aug 26, 2025
mp911de pushed a commit that referenced this pull request Aug 26, 2025
……)` JPQL.

Signed-off-by: Minho Park <[email protected]>
Closes #3990
Original pull request: #3993
mp911de added a commit that referenced this pull request Aug 26, 2025
Add integration tests.

See #3990
Original pull request: #3993
mp911de pushed a commit that referenced this pull request Aug 26, 2025
……)` JPQL.

Signed-off-by: Minho Park <[email protected]>
Closes #3990
Original pull request: #3993
mp911de added a commit that referenced this pull request Aug 26, 2025
Add integration tests.

See #3990
Original pull request: #3993
mp911de pushed a commit that referenced this pull request Aug 26, 2025
……)` JPQL.

Signed-off-by: Minho Park <[email protected]>
Closes #3990
Original pull request: #3993
mp911de added a commit that referenced this pull request Aug 26, 2025
Add integration tests.

See #3990
Original pull request: #3993
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has: ai-slop An bloated issue that contains low-value AI-generated content. type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EclipseLink fails resolving unqualified identifier property using IN on batch delete by Id
3 participants