39
39
import org .springframework .data .jdbc .core .convert .JdbcConverter ;
40
40
import org .springframework .data .mapping .PersistentPropertyPath ;
41
41
import org .springframework .data .mapping .PersistentPropertyPaths ;
42
+ import org .springframework .data .relational .core .conversion .AggregateChangeWithRoot ;
42
43
import org .springframework .data .relational .core .conversion .DbAction ;
43
44
import org .springframework .data .relational .core .conversion .IdValueSource ;
44
45
import org .springframework .data .relational .core .conversion .MutableAggregateChange ;
@@ -70,7 +71,7 @@ public class AggregateChangeIdGenerationImmutableUnitTests {
70
71
71
72
RelationalMappingContext context = new RelationalMappingContext ();
72
73
JdbcConverter converter = mock (JdbcConverter .class );
73
- DbAction .WithEntity <? > rootInsert = new DbAction .InsertRoot <>(entity , IdValueSource .GENERATED );
74
+ DbAction .WithRoot < DummyEntity > rootInsert = new DbAction .InsertRoot <>(entity , IdValueSource .GENERATED );
74
75
75
76
DataAccessStrategy accessStrategy = mock (DataAccessStrategy .class );
76
77
@@ -79,8 +80,8 @@ public class AggregateChangeIdGenerationImmutableUnitTests {
79
80
@ Test // DATAJDBC-291
80
81
public void singleRoot () {
81
82
82
- MutableAggregateChange <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
83
- aggregateChange .addAction (rootInsert );
83
+ AggregateChangeWithRoot <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
84
+ aggregateChange .setRootAction (rootInsert );
84
85
85
86
entity = executor .execute (aggregateChange );
86
87
@@ -92,8 +93,8 @@ public void simpleReference() {
92
93
93
94
entity = entity .withSingle (content );
94
95
95
- MutableAggregateChange <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
96
- aggregateChange .addAction (rootInsert );
96
+ AggregateChangeWithRoot <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
97
+ aggregateChange .setRootAction (rootInsert );
97
98
aggregateChange .addAction (createInsert ("single" , content , null ));
98
99
99
100
entity = executor .execute (aggregateChange );
@@ -110,8 +111,8 @@ public void listReference() {
110
111
111
112
entity = entity .withContentList (asList (content , content2 ));
112
113
113
- MutableAggregateChange <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
114
- aggregateChange .addAction (rootInsert );
114
+ AggregateChangeWithRoot <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
115
+ aggregateChange .setRootAction (rootInsert );
115
116
aggregateChange .addAction (createInsert ("contentList" , content , 0 ));
116
117
aggregateChange .addAction (createInsert ("contentList" , content2 , 1 ));
117
118
@@ -129,8 +130,8 @@ public void mapReference() {
129
130
130
131
entity = entity .withContentMap (createContentMap ("a" , content , "b" , content2 ));
131
132
132
- MutableAggregateChange <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
133
- aggregateChange .addAction (rootInsert );
133
+ AggregateChangeWithRoot <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
134
+ aggregateChange .setRootAction (rootInsert );
134
135
aggregateChange .addAction (createInsert ("contentMap" , content , "a" ));
135
136
aggregateChange .addAction (createInsert ("contentMap" , content2 , "b" ));
136
137
@@ -149,8 +150,8 @@ public void setIdForDeepReference() {
149
150
DbAction .Insert <?> parentInsert = createInsert ("single" , content , null );
150
151
DbAction .Insert <?> insert = createDeepInsert ("single" , tag1 , null , parentInsert );
151
152
152
- MutableAggregateChange <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
153
- aggregateChange .addAction (rootInsert );
153
+ AggregateChangeWithRoot <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
154
+ aggregateChange .setRootAction (rootInsert );
154
155
aggregateChange .addAction (parentInsert );
155
156
aggregateChange .addAction (insert );
156
157
@@ -171,8 +172,8 @@ public void setIdForDeepReferenceElementList() {
171
172
DbAction .Insert <?> insert1 = createDeepInsert ("tagList" , tag1 , 0 , parentInsert );
172
173
DbAction .Insert <?> insert2 = createDeepInsert ("tagList" , tag2 , 1 , parentInsert );
173
174
174
- MutableAggregateChange <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
175
- aggregateChange .addAction (rootInsert );
175
+ AggregateChangeWithRoot <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
176
+ aggregateChange .setRootAction (rootInsert );
176
177
aggregateChange .addAction (parentInsert );
177
178
aggregateChange .addAction (insert1 );
178
179
aggregateChange .addAction (insert2 );
@@ -197,8 +198,8 @@ public void setIdForDeepElementSetElementSet() {
197
198
DbAction .Insert <?> insert1 = createDeepInsert ("tagSet" , tag1 , null , parentInsert );
198
199
DbAction .Insert <?> insert2 = createDeepInsert ("tagSet" , tag2 , null , parentInsert );
199
200
200
- MutableAggregateChange <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
201
- aggregateChange .addAction (rootInsert );
201
+ AggregateChangeWithRoot <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
202
+ aggregateChange .setRootAction (rootInsert );
202
203
aggregateChange .addAction (parentInsert );
203
204
aggregateChange .addAction (insert1 );
204
205
aggregateChange .addAction (insert2 );
@@ -230,8 +231,8 @@ public void setIdForDeepElementListSingleReference() {
230
231
DbAction .Insert <?> insert1 = createDeepInsert ("single" , tag1 , null , parentInsert1 );
231
232
DbAction .Insert <?> insert2 = createDeepInsert ("single" , tag2 , null , parentInsert2 );
232
233
233
- MutableAggregateChange <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
234
- aggregateChange .addAction (rootInsert );
234
+ AggregateChangeWithRoot <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
235
+ aggregateChange .setRootAction (rootInsert );
235
236
aggregateChange .addAction (parentInsert1 );
236
237
aggregateChange .addAction (parentInsert2 );
237
238
aggregateChange .addAction (insert1 );
@@ -261,8 +262,8 @@ public void setIdForDeepElementListElementList() {
261
262
DbAction .Insert <?> insert2 = createDeepInsert ("tagList" , tag2 , 0 , parentInsert2 );
262
263
DbAction .Insert <?> insert3 = createDeepInsert ("tagList" , tag3 , 1 , parentInsert2 );
263
264
264
- MutableAggregateChange <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
265
- aggregateChange .addAction (rootInsert );
265
+ AggregateChangeWithRoot <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
266
+ aggregateChange .setRootAction (rootInsert );
266
267
aggregateChange .addAction (parentInsert1 );
267
268
aggregateChange .addAction (parentInsert2 );
268
269
aggregateChange .addAction (insert1 );
@@ -296,8 +297,8 @@ public void setIdForDeepElementMapElementMap() {
296
297
DbAction .Insert <?> insert2 = createDeepInsert ("tagMap" , tag2 , "222" , parentInsert2 );
297
298
DbAction .Insert <?> insert3 = createDeepInsert ("tagMap" , tag3 , "333" , parentInsert2 );
298
299
299
- MutableAggregateChange <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
300
- aggregateChange .addAction (rootInsert );
300
+ AggregateChangeWithRoot <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
301
+ aggregateChange .setRootAction (rootInsert );
301
302
aggregateChange .addAction (parentInsert1 );
302
303
aggregateChange .addAction (parentInsert2 );
303
304
aggregateChange .addAction (insert1 );
@@ -335,8 +336,8 @@ public void setIdForDeepElementListSingleReferenceWithIntermittentNoId() {
335
336
DbAction .Insert <?> insert1 = createDeepInsert ("single" , tag1 , null , parentInsert1 );
336
337
DbAction .Insert <?> insert2 = createDeepInsert ("single" , tag2 , null , parentInsert2 );
337
338
338
- MutableAggregateChange <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
339
- aggregateChange .addAction (rootInsert );
339
+ AggregateChangeWithRoot <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
340
+ aggregateChange .setRootAction (rootInsert );
340
341
aggregateChange .addAction (parentInsert1 );
341
342
aggregateChange .addAction (parentInsert2 );
342
343
aggregateChange .addAction (insert1 );
@@ -361,8 +362,8 @@ public void setIdForEmbeddedDeepReference() {
361
362
362
363
DbAction .Insert <?> parentInsert = createInsert ("embedded.single" , tag1 , null );
363
364
364
- MutableAggregateChange <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
365
- aggregateChange .addAction (rootInsert );
365
+ AggregateChangeWithRoot <DummyEntity > aggregateChange = MutableAggregateChange .forSave (entity );
366
+ aggregateChange .setRootAction (rootInsert );
366
367
aggregateChange .addAction (parentInsert );
367
368
368
369
entity = executor .execute (aggregateChange );
0 commit comments