Skip to content

Commit c110496

Browse files
committed
HHH-16383 - NaturalIdClass
1 parent 2924670 commit c110496

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ class Book {
539539
}
540540
----
541541

542+
See the link:{doc-user-guide-url}#naturalid[User Guide] for more details about natural ids.
542543

543544
The payoff for doing this extra work, as we will see <<natural-id-cache,much later>>, is that we can take advantage of optimized natural id lookups that make use of the second-level cache.
544545

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,8 @@ For multi-attribute natural ids, Hibernate will accept a number of forms:
391391
Each of the operations we've seen so far affects a single entity instance passed as an argument.
392392
But there's a way to set things up so that an operation will propagate to associated entities.
393393

394+
See the link:{doc-user-guide-url}#find-by-natural-id[User Guide] for more details about loading by natural ids.
395+
394396
[[cascade]]
395397
=== Cascading persistence operations
396398

@@ -648,6 +650,8 @@ We also have some operations for working with lookups by <<natural-identifiers,
648650
| `byMultipleNaturalId()` | Lets us load a _batch_ of natural ids at the same time
649651
|===
650652

653+
Again, see the link:{doc-user-guide-url}#find-by-natural-id[User Guide] for more details about loading by natural ids.
654+
651655
Here's how we can retrieve an entity by its composite natural id:
652656

653657
[source,java]

documentation/src/main/asciidoc/userguide/chapters/domain/natural_id.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Hibernate historically offered the dedicated `byNaturalId()`, `bySimpleNaturalId
123123
====
124124

125125

126-
[[load-by-natural-id-example]]
126+
[[find-by-natural-id-example]]
127127
.Loading by natural id
128128
====
129129
[source,java]

hibernate-core/src/main/java/org/hibernate/internal/find/FindByKeyOperation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ protected Object coerceId(Object id, SessionFactoryImplementor factory) {
287287
}
288288

289289
try {
290-
return entityDescriptor.getIdentifierMapping().getJavaType().coerce( id, factory::getTypeConfiguration );
290+
return entityDescriptor.getIdentifierMapping().getJavaType().coerce( id );
291291
}
292292
catch ( Exception e ) {
293293
throw new IllegalArgumentException( "Argument '" + id

0 commit comments

Comments
 (0)