diff --git a/documentation/src/main/asciidoc/introduction/Entities.adoc b/documentation/src/main/asciidoc/introduction/Entities.adoc index e4a96126ee..fad1d02272 100644 --- a/documentation/src/main/asciidoc/introduction/Entities.adoc +++ b/documentation/src/main/asciidoc/introduction/Entities.adoc @@ -927,7 +927,7 @@ Collection books; [NOTE] .`Set`, `List`, or `Collection`? ==== -A one to many association mapped to a foreign key can never contain duplicate elements, so `Set` seems like the most semantically correct Java collection type to use here, and so that's the conventional practice in the Hibernate community. +A one-to-many association mapped to a foreign key can never contain duplicate elements, so `Set` seems like the most semantically correct Java collection type to use here, and so that's the conventional practice in the Hibernate community. The catch associated with using a set is that we must carefully ensure that `Book` has a high-quality implementation of <>. Now, that's not necessarily a bad thing, since a quality `equals()` is independently useful. diff --git a/documentation/src/main/asciidoc/introduction/Mapping.adoc b/documentation/src/main/asciidoc/introduction/Mapping.adoc index 6cf560b1b0..0dfcc6e9f0 100644 --- a/documentation/src/main/asciidoc/introduction/Mapping.adoc +++ b/documentation/src/main/asciidoc/introduction/Mapping.adoc @@ -264,6 +264,8 @@ class Book { } ---- +Here, there should be a `UNIQUE` constraint on one of the columns of the association table. + [source,java] ---- @Entity @@ -276,6 +278,8 @@ class Author { } ---- +Here, there should be a `UNIQUE` constraint on _both_ columns of the association table. + .`@JoinTable` annotation members [cols=",8"] |===