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
https://jira.springsource.org/browse/DATAJPA-209
to track our enhancement request.
Basically, it would allow something like this (notice @NullMeans annotation):
Allowed values of @NullMeans are EQUALS (current behavior), IS (proposed) and IGNORED (proposed).Code:public interface FooRepository extends JpaRepository<Foo> { List<Foo> findByBarAndGoo(@NullMeans(IGNORED) Bar bar, @NullMeans(IGNORED) Goo goo); }
WDYT?
-matthew


Reply With Quote