Announcement Announcement Module
No announcement yet.
Null parameter value handling improvement Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Null parameter value handling improvement

    Null handling in query method parameters doesn't meet our needs, because it seems to always produce an "= NULL" clause in our queries, which always returns false. We need null parameter values to be ignored in the query.

    FYI, I've entered

    to track our enhancement request.

    Basically, it would allow something like this (notice @NullMeans annotation):
    public interface FooRepository extends JpaRepository<Foo> {
      List<Foo> findByBarAndGoo(@NullMeans(IGNORED) Bar bar, @NullMeans(IGNORED) Goo goo);
    Allowed values of @NullMeans are EQUALS (current behavior), IS (proposed) and IGNORED (proposed).



  • #2
    NB: this is a shameless troll for votes since more folks follow the forum than the issue tracker.

    The "= NULL" v. "IS NULL" issue is indeed fixed in 1.1.0.RC1. However, the enhancement proposed in (controlling null behavior) still holds, and the enum values are reduced to just IS and IGNORED.

    The SD JPA team is waiting for community feedback about and votes for the issue. If you feel that being able to control null handling behavior in queries with @NullMeans(IS) to produce "IS NULL" conditions (the current behavior) or @NullMeans(IGNORED) to exclude the condition from the query, then please vote for