spring-projects / spring-projects/spring-data-relational
Embedded objects are mostly ignored in QBE queries
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 827
- Forks
- 394
- PR merge metrics
- No merged PRs in 30d
Description
When investigating the #1986, I discovered that the embedded objects are not even considered during QBE to CriteriaDefinition conversion.
Here is the sample repo (MRE) that demonstrates the problem, the very specific test.
In the example, the ignoreCase setting is ignored. Other settings like the null handling for embedded properties described in #1986 are ignored as well.
The reason why it happens is that the algorithm in the RelationalQueryMapper only considers direct properties of an aggregate, meaning the property.getName() of direct properties is analyzed, but not deeper not recursive.
So the problem is far deeper, I'll handle it myself as well.
CC: @schauder @mp911de
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproducing test in EnclosingClassRepositoryTest.java from the linked sample repository, then read RelationalExampleMapper.java around the aggregate-property handling described in the issue. Verify how embedded properties are represented during QBE-to-CriteriaDefinition conversion. Done means the embedded object's ignoreCase and other probe settings are no longer ignored and the specific test passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100