update user guide regarding the new feature of `@SortNatural` by default

This commit is contained in:
Nathan Xu 2020-03-29 21:24:10 -04:00 committed by Andrea Boriero
parent 7e571cc75c
commit c23ded50ba
1 changed files with 7 additions and 1 deletions

View File

@ -502,7 +502,7 @@ According to the `SortedSet` contract, all elements must implement the `Comparab
[[collections-unidirectional-sorted-set]]
===== Unidirectional sorted sets
A `SortedSet` that relies on the natural sorting order given by the child element `Comparable` implementation logic must be annotated with the `@SortNatural` Hibernate annotation.
A `SortedSet` that relies on the natural sorting order given by the child element `Comparable` implementation logic might be annotated with the `@SortNatural` Hibernate annotation.
[[collections-unidirectional-sorted-set-natural-comparator-example]]
.Unidirectional natural sorted set
@ -542,6 +542,12 @@ include::{sourcedir}/UnidirectionalComparatorSortedSetTest.java[lines=75..77,ind
----
====
[NOTE]
====
Before v6, `@SortNatural` must be used if collection element's natural ordering is relied upon for sorting.
Starting from v6, we can omit `@SortNatural` as it will take effect by default.
====
[[collections-map]]
==== Maps