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
  • 34,031
  • 20
  • 135
  • 241
mohammad_1m2
  • 1,571
  • 5
  • 19
  • 38

0 Answers0