[PR #11558] Introduced finalizeAndExecute to the AbstractSqlWalker, unified SingleStatementExecutor #13099

Closed
opened 2026-01-22 16:16:10 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/11558

State: closed
Merged: No


Fixes #11112

I've taken the approach suggested by @beberlei in https://github.com/doctrine/orm/pull/11188#discussion_r1511681232

This essentially delays setting limit/offset and locking on the SQL to the finalizeAndExecute function, which accepts the Query object as a parameter.

I also unified the SingleSelectExecutor and SingleTableDeleteUpdateExecutor into a single class: SingleStatementExecutor since it was mostly the same implementation.

The Query::getQueryCacheId was changed to no longer care about the firstResult/maxResults parameters, since using them in the cache key results in different cache keys for what is essentially the same query.

I had to expose the selectedClasses field from the SqlWalker since it is used to determine if optimistic locking is possible.

Please let me know if this is an acceptable solution.

If so, I will gladly introduce tests/make any other necessary adjustments, per maintaniers' instructions.

Thank you!

**Original Pull Request:** https://github.com/doctrine/orm/pull/11558 **State:** closed **Merged:** No --- Fixes #11112 I've taken the approach suggested by @beberlei in https://github.com/doctrine/orm/pull/11188#discussion_r1511681232 This essentially delays setting limit/offset and locking on the SQL to the `finalizeAndExecute` function, which accepts the `Query` object as a parameter. I also unified the `SingleSelectExecutor` and `SingleTableDeleteUpdateExecutor` into a single class: `SingleStatementExecutor` since it was mostly the same implementation. The `Query::getQueryCacheId` was changed to no longer care about the `firstResult`/`maxResults` parameters, since using them in the cache key results in different cache keys for what is essentially the same query. I had to expose the `selectedClasses` field from the `SqlWalker` since it is used to determine if optimistic locking is possible. Please let me know if this is an acceptable solution. If so, I will gladly introduce tests/make any other necessary adjustments, per maintaniers' instructions. Thank you!
admin added the pull-request label 2026-01-22 16:16:10 +01:00
admin closed this issue 2026-01-22 16:16:11 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#13099