You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To simplify things, you're looking for sorting support through keywords/by passing in a Sort object into the query method. Query by Example isn't applicable in this context.
Correct, I'm looking for sorting support through keywords (findAllOrderByFoo90) as well as passing in a Sort object into the query method.
My mistake with Query by Example; I assumed that since it called it out as an unsupported feature that there was a use case in which it was desirable.
For reference: we are in need of sorting functionality, and because findAll() (or findByBar()) returns an UnmodifiableList, our workaround involves duplicating the returned list and then sorting it through Java's List.sort(). It would be far easier, and more space efficient, to have orderBy working and returning a sorted list.
Consider this POJO code:
The following code would be expected to return elements sorted:
As described in this StackOverflow post) and corroborated by several users in the comments (and my own project), this does return all elements, but they are not sorted as expected. Indeed, the table of supported keywords inside method names does not list
OrderBy
as a valid keyword.The section for Query By Example also specifically says that
findAll
with sorting is not supported.This is important functionality that I would like to see supported in future releases.
The text was updated successfully, but these errors were encountered: