Conversation
For entities using JPA property access, a Kotlin Boolean property named isActive is exposed by Spring Data as isActive but by the JPA metamodel as active, because property access derives the attribute name from the isActive() getter. Neither findByActiveTrue() nor findByIsActiveTrue() resolves end to end. Resolve the parsed property path segment against the metamodel first and, only if that fails for an is-prefixed segment, accept the attribute that property access derives from the very same zero-argument boolean getter. Query and Criteria path building then use the resolved attribute names. Closes spring-projects#4303 Signed-off-by: Seongho Eom <esh0821@snu.ac.kr>
mp911de
force-pushed
the
main
branch
2 times, most recently
from
August 5, 2026 14:13
4887543 to
c43320e
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.
Closes #4303
A Kotlin Boolean property named
isActiveis exposed to Spring Data asisActive, while a JPA property-access mapping derives the metamodel attributeactivefrom theisActive()getter. As a result,findByIsActiveTrue()parses successfully but renders an invalid JPA path.The parsed segment is now resolved against the JPA metamodel first. If no direct attribute exists, the decapitalized name is used only when the metamodel attribute is read through the same zero-argument
booleanorBooleangetter. Direct attributes such as a field-accessisActiveretain precedence, so this does not introduce general accessor-name aliasing.The change covers JPQL and Criteria derived-query paths, with regression tests for direct-attribute precedence, nested paths, keyset use, and an unrelated
getFooaccessor.