From c23ded50ba38887fa835b1d4252ee30cc7b44552 Mon Sep 17 00:00:00 2001 From: Nathan Xu Date: Sun, 29 Mar 2020 21:24:10 -0400 Subject: [PATCH] update user guide regarding the new feature of `@SortNatural` by default --- .../asciidoc/userguide/chapters/domain/collections.adoc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/documentation/src/main/asciidoc/userguide/chapters/domain/collections.adoc b/documentation/src/main/asciidoc/userguide/chapters/domain/collections.adoc index 8205d7d209..63c231db77 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/domain/collections.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/domain/collections.adoc @@ -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