Hibernate ordering in sql
问题 Is it possible to sort the Set collection using hibernate, in sql without using SortedSet interface, without using @OrderBy annotation - just using criteria's addOrder. I've tried it and it adds order by clause but the set isn't sorted. I use hibernate 3.4. 回答1: NHibernate Sets don't have "order" even though the set mapping supports an order-by. See Ayende's explanation: Note that [order-by] does not work with generic sets and that in general, you don’t want to rely on those ordering