From a25034907d1a8627caf06ed54735d550aeb42d9a Mon Sep 17 00:00:00 2001 From: Maximilian Date: Thu, 25 Sep 2025 12:58:46 +0200 Subject: [PATCH] remove that id should be var All the code snippets show `val id` and during manual tests that version worked. Therefore this sentence is misleading and might be better removed. --- docs/topics/jvm/jvm-spring-boot-using-crudrepository.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/topics/jvm/jvm-spring-boot-using-crudrepository.md b/docs/topics/jvm/jvm-spring-boot-using-crudrepository.md index b4f8c9136ce..1b455ea93f5 100644 --- a/docs/topics/jvm/jvm-spring-boot-using-crudrepository.md +++ b/docs/topics/jvm/jvm-spring-boot-using-crudrepository.md @@ -84,7 +84,7 @@ First, you need to adjust the `Message` class for work with the `CrudRepository`

This function works with an assumption that the new object doesn't have an id in the database. Hence, the id should be null for insertion.

-

If the id isn't null, CrudRepository assumes that the object already exists in the database and this is an update operation as opposed to an insert operation. After the insert operation, the id will be generated by the data store and assigned back to the Message instance. This is why the id property should be declared using the var keyword.

+

If the id isn't null, CrudRepository assumes that the object already exists in the database and this is an update operation as opposed to an insert operation. After the insert operation, the id will be generated by the data store and assigned back to the Message instance.