Fix/avoid count queries aot - #4340
Open
UsmanEjaz10 wants to merge 2 commits into
Open
Conversation
…pring-projectsGH-4338) Signed-off-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Claude Code <noreply@anthropic.com>
UsmanEjaz10
force-pushed
the
fix/avoid-count-queries-aot
branch
from
August 31, 2026 19:49
0b2ab08 to
43d1f8e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description (Test driven development + Claude-code)
Issue #4338: Count Query Optimization - Summary
❌ Why The Issue Occurred
Spring Data JPA generated count queries for every repository method during AOT compilation, even when pagination wasn't used.
Example:
Impact:
🔴 Failing Test Case Written First (TDD)
File:
QueriesFactoryUnitTests.javaTest Failure (Proved Bug):
✅ How I Solved It
Added pagination check in
QueriesFactory.java(3 methods):Methods Modified:
Method | Location | Change -- | -- | -- buildStringQuery() | Line ~183-190 | Add pagination check buildNamedQuery() | Line ~204-214 | Add pagination check buildPartTreeQuery() | Line ~289-301 | Add pagination check✔️ Files Modified
📋 Test Coverage
Result: 3/3 tests passing ✅
✅ Status