Generic Filter : enhance ui to select records with null attribute


Generic Filter allows following operators for a String attribute:

  • contains
  • equals (=)
  • in
  • not in
  • differs from <>
  • does not contain
  • not empty
  • begins with
  • ends with

It misses the condition ‘is empty’ generating JPQL ‘is null’.

For instance let’s have a column ‘Etiquettes’ (tags), the goal is to select records where ‘tags’ column does not contain the tag ‘imprime’. Knowing that tags column can be null.

To do so, we are forced to create a OR group with 2 conditions:

  • tags does not contain ‘imprime’
  • or tags is not empty = false <=> not not empty

This is a bit cumbersome and far from straightforward for any people discovering the feature, being a developer or a user.