Hibernate: ordering a Set
问题 I have a class Person who has a set of Books. It is not meaningful in the particular case to have an ordered or sorted collection. Say now that I have a search page with a table showing the join of Person and Book. I want to be able to sort the results by fields from both Person AND Book, and then get a List from Hibernate, and iterate over it. Because the collection is a Set, the ordering of the Books has vanished (PersistentSet of Hibernate wraps a HashSet of Books, which is not ordered).