From 9f827fa1ba0fe73d03d6092eb4b8e8b6c4a5e07e Mon Sep 17 00:00:00 2001 From: Jens Schauder Date: Mon, 18 Oct 2021 11:30:24 +0200 Subject: [PATCH] Add a note about the new getById method. See #2169 --- src/main/asciidoc/new-features.adoc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/asciidoc/new-features.adoc b/src/main/asciidoc/new-features.adoc index 952975692..1c71bcf5d 100644 --- a/src/main/asciidoc/new-features.adoc +++ b/src/main/asciidoc/new-features.adoc @@ -1,6 +1,14 @@ [[new-features]] = New & Noteworthy +[[new-features.2-5-0]] +== What's New in Spring Data JPA 2.5 + +There is a new `getById` method in the `JpaRepository` which will replace `getOne`, which is now deprecated. +Since this method returns a reference this changes the behaviour of an existing `getById` method which before was implemented by query derivation. +This in turn might lead to an unexpected `LazyLoadingException` when accessing attributes of that reference outside a transaction. +To avoid this please rename your existing `getById` method to `getXyzById` with `Xyz` being an arbitrary string. + [[new-features.1-11-0]] == What's New in Spring Data JPA 1.11