Annotation Interface SortNatural


@Target({METHOD,FIELD}) @Retention(RUNTIME) public @interface SortNatural
Sort a Set or Map in its natural order

Sorting is performed in memory, by Java's TreeSet or TreeMap, and is maintained by any operation that mutates the collection.

  • Use SortComparator to sort the collection in memory using a Comparator.
  • Use OrderBy to order using an expression written in HQL.
  • Use SQLOrder to order using an expression written in native SQL.

It is illegal to use both SortNatural and SortComparator.

See Also: