spring-projects / spring-projects/spring-data-commons
Latest Refactor on QueryDsl argument resolution breaks it when pagination and other parameters are supplied to the request [DATACMNS-1559]
@mp911de is already working on this.
Since Dec 30, 2020.
- Dominant language
- Java
- Stars
- 838
- Forks
- 730
- PR merge metrics
- No merged PRs in 30d
Description
Marc opened DATACMNS-1559 and commented
QuerydslPredicateBuilder.getPredicate() was refactored 2 or 3 commits ago, changing the logic in a way that now when incoming params multimap is empty, a new empty BooleanBuilder() instance is returned.
But when params multimap comes populated and it is iterated without any successful binding , instead of returning the coherent empty BooleanBuilder() instance, its getValue(), which equals null, is returned instead.
This means that behavior is inconsistent for when no relevant associations are found, the result is different depending on whether the multimap is empty or contanis footobeignored.
This effectively affects current version of spring-data-rest's QuerydslAwareRootResourceInformationHandlerMethodArgumentResolver, since it was also refactored to instantiate QuerydslRepositoryInvokerAdapter only on the event of non null preficates, otherwise it returns the default invoker which is the UnwrappingRepository one that ignores querydsl predicates.
This means that current released library resolves a QueryDsl aware invoker only if you don't provide pagination or other kinds of params
Affects: 2.1.9 (Lovelace SR9)
1 votes, 3 watchers
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.
Assessment
This issue has not been assessed yet.