Skip to content

Commit

Permalink
Update userguide about natural-ids
Browse files Browse the repository at this point in the history
Signed-off-by: Thorsten <[email protected]>
  • Loading branch information
tg-freigmbh committed Dec 2, 2024
1 parent cbad5bf commit f06aa60
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
:extrasdir: extras

Natural ids represent domain model unique identifiers that have a meaning in the real world too.
Even if a natural id does not make a good primary key (surrogate keys being usually preferred), it's still useful to tell Hibernate about it.
As we will see later, Hibernate provides a dedicated, efficient API for loading an entity by its natural id much like it offers for loading by identifier (PK).

[IMPORTANT]
====
NaturalId Annotations are a proprietary Hibernate feature and not a part of JPA. They should only be used
if you intent to use NaturalIdLoadAccess, which is also a proprietary hibernate feature.
All values used in a natural id must be non-nullable.
For natural id mappings using a to-one association, this precludes the use of not-found
Expand Down

0 comments on commit f06aa60

Please sign in to comment.