Skip to content

Commit

Permalink
Clarify not to map backreferences and key columns.
Browse files Browse the repository at this point in the history
Closes #504
  • Loading branch information
schauder committed Oct 20, 2023
1 parent 13d4f12 commit 7a7d3a3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/antora/modules/ROOT/pages/jdbc/mapping.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7a7d3a3

Please sign in to comment.