sorting - Sort By Boolean value in Spring Data -
i'm using spring data , have repo method returning products. need sort result list availability, available products should displayed first.
product has boolean field 'available'. in order achieve sorting availability i'm trying define repository method like
list<product> findallorderbyavailable();
but doesn't work. idea if achievable spring data?
following spring data documentation , have insert by
after findall
indicate thats criteria starts, , you're missing order asc
or desc
, should this:
list<product> findallbyorderbyavailableasc(); //or desc
Comments
Post a Comment