Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QuerydslPredicateBuilder#isSingleElementCollectionWithoutText is too restrictive [DATACMNS-1443]

spring-projects-issues opened this issue Dec 10, 2018 · 1 comment
type: enhancement


Copy link

spring-projects-issues commented Dec 10, 2018

SanderKleykens opened DATACMNS-1443 and commented

QuerydslPredicateBuilder#getPredicate uses a function called isSingleElementCollectionWithoutText to filter out all single element collection values that are null/empty string/string with nothing but whitespace.
Sometimes you do want to use values that are just an empty string or a string with nothing but whitespaces.

One workaround is to add the same value twice, so it's not regarded as a single element collection. In this case, the value doesn't get filtered out.
For example, when using the QueryDSL Web Support, GETting "/notes?name=%20" will end up returning all notes since "name= " gets dropped by QuerydslPredicateBuilder#isSingleElementCollectionWithoutText.
"/notes?name=%20&name=%20" will end up returning only the notes with " " as name

Affects: 2.0.12 (Kay SR12), 1.13.17 (Ingalls SR17), 2.1.3 (Lovelace SR3)

Referenced from: commits d75ab30, f2967a9, 296d105, 0609f47

Backported to: 2.1.4 (Lovelace SR4), 2.0.13 (Kay SR13), 1.13.18 (Ingalls SR18)

Copy link

spring-projects-issues commented Dec 10, 2018

Oliver Drotbohm commented

That's im place now. We now rather use hasLength(…)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
type: enhancement
None yet

No branches or pull requests

2 participants