Package org.hibernate.annotations
Annotation Type OrderBy
-
@Target({METHOD,FIELD}) @Retention(RUNTIME) public @interface OrderBy
Order a collection using an expression written in native SQL.The order is applied by the database when the collection is fetched, but is not maintained by operations that mutate the collection in memory. If the collection is a
SetorMap, the order is maintained using aLinkedHashSetorLinkedHashMap.- Use
OrderByto order using an expression written in HQL. - Use
SortComparatorto sort the collection in memory using aComparator. - Use
SortNaturalto sort the collection in itsnatural order. - Use
OrderColumnto maintain the order of aListwith a dedicated index column.
It is illegal to use both
OrderByandOrderBy.- See Also:
OrderBy,SortComparator,SortNatural
- Use
-
-
Element Detail
-
clause
String clause
The native SQL expression used to sort the collection elements.
-
-