How can I select the top 100 through Spring data CrudRepository? I want to do something like that by I get an error.
List<Person> findTop100();
I do not want to use queries, hibernate or anything else. I just want to do it through spring data the easy and fast way
Add a postfix "By" but without criteria there would works.
List<Person> findTop100By();
You can use
List<Person> findAllByOrderedBy{Abc}Desc
Where Abc is parameter on which sorting to be done.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With