Skip to content

Commit 6b0f9f8

Browse files
committed
add a WARNING about @manytomany(fetch=EAGER)
1 parent 603e3ef commit 6b0f9f8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

documentation/src/main/asciidoc/introduction/Entities.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,6 +1422,14 @@ However, as before, the order of the elements is not persistent.
14221422
That is, the collection is a _bag_, not a set.
14231423
====
14241424

1425+
[WARNING]
1426+
====
1427+
We don't usually map collections with `fetch=EAGER`, since that usually leads to poor performance and fetching of unnecessary data.
1428+
But this is especially clear in the case of many-to-many associations.
1429+
We don't much employ the word "never" when it comes to object/relational mappings, but here we will:
1430+
**never** write `@ManyToMany(fetch=EAGER)` unless you're deliberately looking for trouble.
1431+
====
1432+
14251433
[[collections]]
14261434
=== Collections of basic values and embeddable objects
14271435

0 commit comments

Comments
 (0)