Commit 4f54291
Optimize entity deletion in SimpleJpaRepository.
This change improves the performance of the delete method by first checking if the entity is already managed by the EntityManager. If so, it removes the entity directly without additional database queries. This optimization can reduce unnecessary database lookups in certain scenarios.
Closes #35641 parent 3ab36fa commit 4f54291
File tree
1 file changed
+8
-5
lines changed- spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support
1 file changed
+8
-5
lines changedLines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| |||
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
| 200 | + | |
| 201 | + | |
203 | 202 | | |
204 | 203 | | |
205 | 204 | | |
206 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
207 | 210 | | |
208 | 211 | | |
209 | 212 | | |
| |||
0 commit comments