8

I want to write some query methods in repository layer. This method must ignore null parameters. For example:

List<Foo> findByBarAndGoo(Bar barParam, @optional Goo gooParam);

This method must be return Foo by this condition:

bar == barParam && goo == gooParam;

if gooParam not null. if gooParam was null then condition change to:

bar == barParam;

Is there any solution? Can someone help me?

Andremoniy
  • 32,711
  • 17
  • 122
  • 230
mohammad_1m2
  • 1,441
  • 4
  • 19
  • 34

0 Answers0