Clarify not to map backreferences and key columns.

Closes #504
This commit is contained in:
Jens Schauder
2023-10-20 11:55:30 +02:00
parent 13d4f120f8
commit 7a7d3a3e83

View File

@@ -72,6 +72,7 @@ Alternatively you may annotate the attribute with `@MappedCollection(idColumn="y
Specifying a key column for a `Set` has no effect.
[[mapping.usage.annotations]]
=== Mapping Annotation Overview
@@ -128,6 +129,9 @@ p1.bestFriend = AggregateReference.to(p2.id);
----
You should not include attributes in your entities to hold the actual value of a back reference, nor of the key column of maps or lists.
If you want these value to be available in your domain model we recommend to do this in a `AfterConvertCallback` and store the values in transient values.
* Types for which you registered suitable [[jdbc.custom-converters, custom conversions]].
:mapped-collection: true