Lets say I have an "Item" table in my database and an "Item" entity object in my Java code JPA mapping.
And I am given a sorted list of "Item" ids, for which I want to retrieve the actual "Items" from the database, with the same ordering as in the given list.
Now I can't really just retrieve the items first and then order them because I only want to retrieve a small range of these items from the database after the ordering.
Is this possible to do? I know that there are ways of doing this using pure SQL, e.g.