Commit 90d8959
committed
Make domain model entities immutable
This commit introduces several major changes to make the
domain model entities immutable:
- It removes the setter of the Entity id
- It creates all entities with an assigned ID as well as
their dependencies which cannot be changed after creation
- The type of the identity field has been changed to a
primitive long in order to avoid nullability issues
- Shallow entity creation has been removed from all DAOs
- All entity creation is now centralized in the job repository
(ie removal of JobExecution#creatStepExecution). Note that
StepExecution#createStepContribution is an exception since
StepContribution is not an Entity
- Superfluous methods "add" and "save" have been removed and
replaced with clearly defined CRUD operations
- Move restartability logic from JobRepository to JobOperator
These changes are important enablers for cleaner and safer APIs.
Resolves #18701 parent 1cd023e commit 90d8959
File tree
210 files changed
+2506
-5528
lines changed- spring-batch-core/src
- main/java/org/springframework/batch/core
- job
- launch
- support
- partition/support
- repository
- dao
- jdbc
- mongodb
- explore
- support
- persistence
- converter
- support
- scope/context
- step
- test
- java/org/springframework/batch/core
- configuration
- annotation
- support
- xml
- explore/support
- job
- builder
- flow
- support
- state
- launch
- support
- listener
- observability/micrometer
- partition
- support
- repository
- dao
- jdbc
- support
- resource
- scope
- context
- step
- builder
- item
- job
- tasklet
- test
- repository
- step
- resources
- org/springframework/batch/core/repository
- dao/jdbc
- support
- spring-batch-docs/modules/ROOT/pages/spring-batch-integration
- spring-batch-integration/src
- main/java/org/springframework/batch/integration/chunk
- test/java/org/springframework/batch/integration
- async
- chunk
- launch
- partition
- spring-batch-samples/src
- main/java/org/springframework/batch/samples/common
- test/java/org/springframework/batch/samples
- partition/jdbc
- skip
- spring-batch-test/src
- main/java/org/springframework/batch/test
- test/java/org/springframework/batch/test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
210 files changed
+2506
-5528
lines changedLines changed: 10 additions & 61 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
| 36 | + | |
36 | 37 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 38 | + | |
47 | 39 | | |
48 | 40 | | |
49 | 41 | | |
50 | 42 | | |
51 | 43 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 44 | + | |
58 | 45 | | |
59 | 46 | | |
60 | 47 | | |
61 | 48 | | |
62 | 49 | | |
63 | 50 | | |
64 | | - | |
| 51 | + | |
65 | 52 | | |
66 | 53 | | |
67 | 54 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | 55 | | |
76 | 56 | | |
77 | 57 | | |
| |||
108 | 88 | | |
109 | 89 | | |
110 | 90 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | 91 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 92 | + | |
| 93 | + | |
129 | 94 | | |
130 | | - | |
131 | | - | |
| 95 | + | |
132 | 96 | | |
133 | 97 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | 98 | | |
147 | 99 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 100 | + | |
152 | 101 | | |
153 | 102 | | |
154 | 103 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
281 | | - | |
| 280 | + | |
| 281 | + | |
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| |||
Lines changed: 39 additions & 114 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
26 | | - | |
| 24 | + | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
| |||
50 | 48 | | |
51 | 49 | | |
52 | 50 | | |
53 | | - | |
| 51 | + | |
54 | 52 | | |
55 | | - | |
| 53 | + | |
56 | 54 | | |
57 | | - | |
| 55 | + | |
58 | 56 | | |
59 | | - | |
| 57 | + | |
60 | 58 | | |
61 | | - | |
| 59 | + | |
62 | 60 | | |
63 | | - | |
| 61 | + | |
64 | 62 | | |
65 | | - | |
| 63 | + | |
66 | 64 | | |
67 | | - | |
| 65 | + | |
68 | 66 | | |
69 | | - | |
| 67 | + | |
70 | 68 | | |
71 | 69 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
98 | 75 | | |
99 | 76 | | |
100 | 77 | | |
101 | | - | |
| 78 | + | |
| 79 | + | |
102 | 80 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 81 | + | |
| 82 | + | |
132 | 83 | | |
133 | 84 | | |
134 | 85 | | |
| |||
204 | 155 | | |
205 | 156 | | |
206 | 157 | | |
207 | | - | |
| 158 | + | |
208 | 159 | | |
209 | | - | |
| 160 | + | |
210 | 161 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
216 | 166 | | |
217 | 167 | | |
218 | 168 | | |
| |||
230 | 180 | | |
231 | 181 | | |
232 | 182 | | |
233 | | - | |
| 183 | + | |
234 | 184 | | |
235 | 185 | | |
236 | | - | |
| 186 | + | |
237 | 187 | | |
238 | 188 | | |
239 | 189 | | |
240 | 190 | | |
241 | 191 | | |
242 | 192 | | |
243 | 193 | | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
| 194 | + | |
256 | 195 | | |
257 | 196 | | |
258 | 197 | | |
| |||
305 | 244 | | |
306 | 245 | | |
307 | 246 | | |
308 | | - | |
| 247 | + | |
309 | 248 | | |
310 | 249 | | |
311 | 250 | | |
312 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
313 | 260 | | |
314 | 261 | | |
315 | 262 | | |
| |||
364 | 311 | | |
365 | 312 | | |
366 | 313 | | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | 314 | | |
379 | 315 | | |
380 | 316 | | |
381 | 317 | | |
382 | 318 | | |
383 | 319 | | |
384 | 320 | | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | 321 | | |
0 commit comments