Skip to content

Commit 9f827fa

Browse files
committed
Add a note about the new getById method.
See #2169
1 parent a31052c commit 9f827fa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/asciidoc/new-features.adoc

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
[[new-features]]
22
= New & Noteworthy
33

4+
[[new-features.2-5-0]]
5+
== What's New in Spring Data JPA 2.5
6+
7+
There is a new `getById` method in the `JpaRepository` which will replace `getOne`, which is now deprecated.
8+
Since this method returns a reference this changes the behaviour of an existing `getById` method which before was implemented by query derivation.
9+
This in turn might lead to an unexpected `LazyLoadingException` when accessing attributes of that reference outside a transaction.
10+
To avoid this please rename your existing `getById` method to `getXyzById` with `Xyz` being an arbitrary string.
11+
412
[[new-features.1-11-0]]
513
== What's New in Spring Data JPA 1.11
614

0 commit comments

Comments
 (0)