Uploaded image for project: 'Spring Data Commons'
  1. Spring Data Commons
  2. DATACMNS-1443

QuerydslPredicateBuilder#isSingleElementCollectionWithoutText is too restrictive

    XMLWordPrintable

    Details

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            olivergierke Oliver Drotbohm
            Reporter:
            sanderkleykens SanderKleykens
            Last updater:
            Christoph Strobl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: