I have a Person class. A person class contains a collection of Friends (also Person objects). A person class also has a LatestLogin property which is the LatestLogin time.
For a given person, I want to return their first 10 friends ordered by descending LatestLogin.
HQL I can do no problem: select friends from Person person inner join person.Friends friends where person = :person order by friends.LatestLogin desc
How do I write this in a Criteria Query? I don't want the containing person object, just a List of the person's friends ordered by LatestLogin.
Here it is: