From d01b3c5f72636011d680ba18846ea7679a9a7792 Mon Sep 17 00:00:00 2001 From: diromero Date: Sat, 31 Jan 2026 23:45:04 -0500 Subject: [PATCH] Fix cache key in PeanutsService: use #result.id to cache saved entity --- app/src/main/java/com/example/app/PeanutsService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/example/app/PeanutsService.java b/app/src/main/java/com/example/app/PeanutsService.java index 2602274..baeca74 100644 --- a/app/src/main/java/com/example/app/PeanutsService.java +++ b/app/src/main/java/com/example/app/PeanutsService.java @@ -16,7 +16,7 @@ public Peanuts getPeanutsById(Long id) { return repository.findById(id).orElse(null); } - @CachePut(value = "peanuts", key = "#peanuts.id") + @CachePut(value = "peanuts", key = "#result.id") public Peanuts savePeanuts(Peanuts peanuts) { return repository.save(peanuts); }