Commit 08085d3
Allow keys other than _id for primary key in MongoItemWriter
When moving data between different data store types, such as
between MongoDB and a SQL database, not all systems have a
"_id" as their pimary key. Most often it has a different
name or can be multiple keys/columns used as a composite
key. This change allows the app to specify an alternate
key or a set of keys which, together, can be used as the
primary key for a MongoDB insert/update/upsert.
Signed-off-by: blake_bauman <[email protected]>1 parent 3076957 commit 08085d3
File tree
2 files changed
+84
-5
lines changed- spring-batch-infrastructure/src/main/java/org/springframework/batch/item/data
- builder
2 files changed
+84
-5
lines changedspring-batch-infrastructure/src/main/java/org/springframework/batch/item/data/MongoItemWriter.java
Lines changed: 50 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
92 | 96 | | |
93 | 97 | | |
94 | 98 | | |
| 99 | + | |
| 100 | + | |
95 | 101 | | |
96 | 102 | | |
97 | 103 | | |
| |||
150 | 156 | | |
151 | 157 | | |
152 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
153 | 180 | | |
154 | 181 | | |
155 | 182 | | |
| |||
200 | 227 | | |
201 | 228 | | |
202 | 229 | | |
203 | | - | |
204 | | - | |
205 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
206 | 238 | | |
207 | 239 | | |
208 | 240 | | |
| |||
216 | 248 | | |
217 | 249 | | |
218 | 250 | | |
219 | | - | |
220 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
221 | 266 | | |
222 | 267 | | |
223 | 268 | | |
| |||
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
79 | 109 | | |
80 | 110 | | |
81 | 111 | | |
| |||
88 | 118 | | |
89 | 119 | | |
90 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
91 | 125 | | |
92 | 126 | | |
93 | 127 | | |
| |||
0 commit comments