-
Notifications
You must be signed in to change notification settings - Fork 367
Commit 91a2199
committed
JdbcAggregateOperations delete by query
Issue link: #1978
Add deleteAllByQuery method to JdbcAggregateOperations
This method enables deleting aggregates based on a query by performing the following steps:
1. Lock the target rows using SELECT ... FOR UPDATE based on the query conditions.
2. Delete sub-entities by leveraging a subquery that selects the matching root rows.
3. Delete the root entities using the query conditions.
But if the query has no criteria, deletion is performed in the same way as deleteAll method of JdbcAggregateOperations
Signed-off-by: JaeYeon Kim <ghgh415263@naver.com>1 parent 245b8e5 commit 91a2199
File tree
15 files changed
+505
-0
lines changed- spring-data-jdbc/src
- main/java/org/springframework/data/jdbc
- core
- convert
- mybatis
- test/java/org/springframework/data/jdbc/core
- convert
- spring-data-relational/src
- main/java/org/springframework/data/relational/core/conversion
- test/java/org/springframework/data/relational/core/conversion
15 files changed
+505
-0
lines changedLines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
33 | + | ||
33 | 34 |
| |
34 | 35 |
| |
35 | 36 |
| |
| |||
101 | 102 |
| |
102 | 103 |
| |
103 | 104 |
| |
105 | + | ||
106 | + | ||
107 | + | ||
108 | + | ||
104 | 109 |
| |
105 | 110 |
| |
106 | 111 |
| |
107 | 112 |
| |
113 | + | ||
114 | + | ||
108 | 115 |
| |
109 | 116 |
| |
110 | 117 |
| |
|
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
60 | 60 |
| |
61 | 61 |
| |
62 | 62 |
| |
63 | + | ||
63 | 64 |
| |
64 | 65 |
| |
65 | 66 |
| |
| |||
169 | 170 |
| |
170 | 171 |
| |
171 | 172 |
| |
173 | + | ||
174 | + | ||
175 | + | ||
176 | + | ||
177 | + | ||
178 | + | ||
179 | + | ||
180 | + | ||
181 | + | ||
182 | + | ||
172 | 183 |
| |
173 | 184 |
| |
174 | 185 |
| |
| |||
177 | 188 |
| |
178 | 189 |
| |
179 | 190 |
| |
191 | + | ||
192 | + | ||
193 | + | ||
194 | + | ||
180 | 195 |
| |
181 | 196 |
| |
182 | 197 |
| |
|
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
40 | 40 |
| |
41 | 41 |
| |
42 | 42 |
| |
43 | + | ||
43 | 44 |
| |
44 | 45 |
| |
45 | 46 |
| |
| |||
328 | 329 |
| |
329 | 330 |
| |
330 | 331 |
| |
332 | + | ||
333 | + | ||
334 | + | ||
335 | + | ||
336 | + | ||
337 | + | ||
338 | + | ||
339 | + | ||
340 | + | ||
331 | 341 |
| |
332 | 342 |
| |
333 | 343 |
| |
|
Lines changed: 19 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
72 | 72 |
| |
73 | 73 |
| |
74 | 74 |
| |
75 | + | ||
75 | 76 |
| |
76 | 77 |
| |
77 | 78 |
| |
| |||
484 | 485 |
| |
485 | 486 |
| |
486 | 487 |
| |
488 | + | ||
489 | + | ||
490 | + | ||
491 | + | ||
492 | + | ||
493 | + | ||
494 | + | ||
495 | + | ||
496 | + | ||
497 | + | ||
498 | + | ||
487 | 499 |
| |
488 | 500 |
| |
489 | 501 |
| |
| |||
672 | 684 |
| |
673 | 685 |
| |
674 | 686 |
| |
687 | + | ||
688 | + | ||
689 | + | ||
690 | + | ||
691 | + | ||
692 | + | ||
693 | + | ||
675 | 694 |
| |
676 | 695 |
| |
677 | 696 |
| |
|
Lines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
47 | 47 |
| |
48 | 48 |
| |
49 | 49 |
| |
50 | + | ||
50 | 51 |
| |
51 | 52 |
| |
52 | 53 |
| |
| |||
128 | 129 |
| |
129 | 130 |
| |
130 | 131 |
| |
132 | + | ||
133 | + | ||
134 | + | ||
135 | + | ||
136 | + | ||
137 | + | ||
138 | + | ||
139 | + | ||
140 | + | ||
141 | + | ||
131 | 142 |
| |
132 | 143 |
| |
133 | 144 |
| |
| |||
138 | 149 |
| |
139 | 150 |
| |
140 | 151 |
| |
152 | + | ||
153 | + | ||
154 | + | ||
155 | + | ||
156 | + | ||
141 | 157 |
| |
142 | 158 |
| |
143 | 159 |
| |
|
Lines changed: 27 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
48 | + | ||
48 | 49 |
| |
49 | 50 |
| |
50 | 51 |
| |
| |||
191 | 192 |
| |
192 | 193 |
| |
193 | 194 |
| |
195 | + | ||
196 | + | ||
197 | + | ||
198 | + | ||
199 | + | ||
200 | + | ||
201 | + | ||
202 | + | ||
203 | + | ||
204 | + | ||
205 | + | ||
206 | + | ||
207 | + | ||
208 | + | ||
209 | + | ||
210 | + | ||
194 | 211 |
| |
195 | 212 |
| |
196 | 213 |
| |
| |||
208 | 225 |
| |
209 | 226 |
| |
210 | 227 |
| |
228 | + | ||
229 | + | ||
230 | + | ||
231 | + | ||
232 | + | ||
233 | + | ||
234 | + | ||
235 | + | ||
236 | + | ||
237 | + | ||
211 | 238 |
| |
212 | 239 |
| |
213 | 240 |
| |
|
Lines changed: 33 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
64 | 64 |
| |
65 | 65 |
| |
66 | 66 |
| |
67 | + | ||
67 | 68 |
| |
68 | 69 |
| |
69 | 70 |
| |
| |||
254 | 255 |
| |
255 | 256 |
| |
256 | 257 |
| |
258 | + | ||
259 | + | ||
260 | + | ||
261 | + | ||
262 | + | ||
263 | + | ||
264 | + | ||
265 | + | ||
266 | + | ||
267 | + | ||
268 | + | ||
269 | + | ||
270 | + | ||
271 | + | ||
272 | + | ||
273 | + | ||
274 | + | ||
275 | + | ||
276 | + | ||
277 | + | ||
278 | + | ||
279 | + | ||
280 | + | ||
257 | 281 |
| |
258 | 282 |
| |
259 | 283 |
| |
| |||
270 | 294 |
| |
271 | 295 |
| |
272 | 296 |
| |
297 | + | ||
298 | + | ||
299 | + | ||
300 | + | ||
301 | + | ||
302 | + | ||
303 | + | ||
304 | + | ||
305 | + | ||
273 | 306 |
| |
274 | 307 |
| |
275 | 308 |
| |
|
Lines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
41 | 41 |
| |
42 | 42 |
| |
43 | 43 |
| |
44 | + | ||
44 | 45 |
| |
45 | 46 |
| |
46 | 47 |
| |
| |||
121 | 122 |
| |
122 | 123 |
| |
123 | 124 |
| |
125 | + | ||
126 | + | ||
127 | + | ||
128 | + | ||
129 | + | ||
130 | + | ||
131 | + | ||
132 | + | ||
133 | + | ||
134 | + | ||
124 | 135 |
| |
125 | 136 |
| |
126 | 137 |
| |
| |||
131 | 142 |
| |
132 | 143 |
| |
133 | 144 |
| |
145 | + | ||
146 | + | ||
147 | + | ||
148 | + | ||
149 | + | ||
134 | 150 |
| |
135 | 151 |
| |
136 | 152 |
| |
|
0 commit comments