@@ -87,10 +87,10 @@ public class JdbcAggregateTemplate implements JdbcAggregateOperations {
87
87
public JdbcAggregateTemplate (ApplicationContext publisher , RelationalMappingContext context , JdbcConverter converter ,
88
88
DataAccessStrategy dataAccessStrategy ) {
89
89
90
- Assert .notNull (publisher , "ApplicationContext must not be null! " );
91
- Assert .notNull (context , "RelationalMappingContext must not be null! " );
92
- Assert .notNull (converter , "RelationalConverter must not be null! " );
93
- Assert .notNull (dataAccessStrategy , "DataAccessStrategy must not be null! " );
90
+ Assert .notNull (publisher , "ApplicationContext must not be null" );
91
+ Assert .notNull (context , "RelationalMappingContext must not be null" );
92
+ Assert .notNull (converter , "RelationalConverter must not be null" );
93
+ Assert .notNull (dataAccessStrategy , "DataAccessStrategy must not be null" );
94
94
95
95
this .publisher = publisher ;
96
96
this .context = context ;
@@ -115,10 +115,10 @@ public JdbcAggregateTemplate(ApplicationContext publisher, RelationalMappingCont
115
115
public JdbcAggregateTemplate (ApplicationEventPublisher publisher , RelationalMappingContext context ,
116
116
JdbcConverter converter , DataAccessStrategy dataAccessStrategy ) {
117
117
118
- Assert .notNull (publisher , "ApplicationEventPublisher must not be null! " );
119
- Assert .notNull (context , "RelationalMappingContext must not be null! " );
120
- Assert .notNull (converter , "RelationalConverter must not be null! " );
121
- Assert .notNull (dataAccessStrategy , "DataAccessStrategy must not be null! " );
118
+ Assert .notNull (publisher , "ApplicationEventPublisher must not be null" );
119
+ Assert .notNull (context , "RelationalMappingContext must not be null" );
120
+ Assert .notNull (converter , "RelationalConverter must not be null" );
121
+ Assert .notNull (dataAccessStrategy , "DataAccessStrategy must not be null" );
122
122
123
123
this .publisher = publisher ;
124
124
this .context = context ;
@@ -137,23 +137,23 @@ public JdbcAggregateTemplate(ApplicationEventPublisher publisher, RelationalMapp
137
137
*/
138
138
public void setEntityCallbacks (EntityCallbacks entityCallbacks ) {
139
139
140
- Assert .notNull (entityCallbacks , "Callbacks must not be null. " );
140
+ Assert .notNull (entityCallbacks , "Callbacks must not be null" );
141
141
142
142
this .entityCallbacks = entityCallbacks ;
143
143
}
144
144
145
145
@ Override
146
146
public <T > T save (T instance ) {
147
147
148
- Assert .notNull (instance , "Aggregate instance must not be null! " );
148
+ Assert .notNull (instance , "Aggregate instance must not be null" );
149
149
150
150
return performSave (instance , changeCreatorSelectorForSave (instance ));
151
151
}
152
152
153
153
@ Override
154
154
public <T > Iterable <T > saveAll (Iterable <T > instances ) {
155
155
156
- Assert .isTrue (instances .iterator ().hasNext (), "Aggregate instances must not be empty! " );
156
+ Assert .isTrue (instances .iterator ().hasNext (), "Aggregate instances must not be empty" );
157
157
158
158
return performSaveAll (instances );
159
159
}
@@ -168,7 +168,7 @@ public <T> Iterable<T> saveAll(Iterable<T> instances) {
168
168
@ Override
169
169
public <T > T insert (T instance ) {
170
170
171
- Assert .notNull (instance , "Aggregate instance must not be null! " );
171
+ Assert .notNull (instance , "Aggregate instance must not be null" );
172
172
173
173
return performSave (instance , entity -> createInsertChange (prepareVersionForInsert (entity )));
174
174
}
@@ -183,7 +183,7 @@ public <T> T insert(T instance) {
183
183
@ Override
184
184
public <T > T update (T instance ) {
185
185
186
- Assert .notNull (instance , "Aggregate instance must not be null! " );
186
+ Assert .notNull (instance , "Aggregate instance must not be null" );
187
187
188
188
return performSave (instance , entity -> createUpdateChange (prepareVersionForUpdate (entity )));
189
189
}
@@ -199,8 +199,8 @@ public long count(Class<?> domainType) {
199
199
@ Override
200
200
public <T > T findById (Object id , Class <T > domainType ) {
201
201
202
- Assert .notNull (id , "Id must not be null! " );
203
- Assert .notNull (domainType , "Domain type must not be null! " );
202
+ Assert .notNull (id , "Id must not be null" );
203
+ Assert .notNull (domainType , "Domain type must not be null" );
204
204
205
205
T entity = accessStrategy .findById (id , domainType );
206
206
if (entity == null ) {
@@ -212,16 +212,16 @@ public <T> T findById(Object id, Class<T> domainType) {
212
212
@ Override
213
213
public <T > boolean existsById (Object id , Class <T > domainType ) {
214
214
215
- Assert .notNull (id , "Id must not be null! " );
216
- Assert .notNull (domainType , "Domain type must not be null! " );
215
+ Assert .notNull (id , "Id must not be null" );
216
+ Assert .notNull (domainType , "Domain type must not be null" );
217
217
218
218
return accessStrategy .existsById (id , domainType );
219
219
}
220
220
221
221
@ Override
222
222
public <T > Iterable <T > findAll (Class <T > domainType , Sort sort ) {
223
223
224
- Assert .notNull (domainType , "Domain type must not be null! " );
224
+ Assert .notNull (domainType , "Domain type must not be null" );
225
225
226
226
Iterable <T > all = accessStrategy .findAll (domainType , sort );
227
227
return triggerAfterConvert (all );
@@ -230,7 +230,7 @@ public <T> Iterable<T> findAll(Class<T> domainType, Sort sort) {
230
230
@ Override
231
231
public <T > Page <T > findAll (Class <T > domainType , Pageable pageable ) {
232
232
233
- Assert .notNull (domainType , "Domain type must not be null! " );
233
+ Assert .notNull (domainType , "Domain type must not be null" );
234
234
235
235
Iterable <T > items = triggerAfterConvert (accessStrategy .findAll (domainType , pageable ));
236
236
List <T > content = StreamSupport .stream (items .spliterator (), false ).collect (Collectors .toList ());
@@ -241,7 +241,7 @@ public <T> Page<T> findAll(Class<T> domainType, Pageable pageable) {
241
241
@ Override
242
242
public <T > Iterable <T > findAll (Class <T > domainType ) {
243
243
244
- Assert .notNull (domainType , "Domain type must not be null! " );
244
+ Assert .notNull (domainType , "Domain type must not be null" );
245
245
246
246
Iterable <T > all = accessStrategy .findAll (domainType );
247
247
return triggerAfterConvert (all );
@@ -250,8 +250,8 @@ public <T> Iterable<T> findAll(Class<T> domainType) {
250
250
@ Override
251
251
public <T > Iterable <T > findAllById (Iterable <?> ids , Class <T > domainType ) {
252
252
253
- Assert .notNull (ids , "Ids must not be null! " );
254
- Assert .notNull (domainType , "Domain type must not be null! " );
253
+ Assert .notNull (ids , "Ids must not be null" );
254
+ Assert .notNull (domainType , "Domain type must not be null" );
255
255
256
256
Iterable <T > allById = accessStrategy .findAllById (ids , domainType );
257
257
return triggerAfterConvert (allById );
@@ -260,8 +260,8 @@ public <T> Iterable<T> findAllById(Iterable<?> ids, Class<T> domainType) {
260
260
@ Override
261
261
public <S > void delete (S aggregateRoot , Class <S > domainType ) {
262
262
263
- Assert .notNull (aggregateRoot , "Aggregate root must not be null! " );
264
- Assert .notNull (domainType , "Domain type must not be null! " );
263
+ Assert .notNull (aggregateRoot , "Aggregate root must not be null" );
264
+ Assert .notNull (domainType , "Domain type must not be null" );
265
265
266
266
IdentifierAccessor identifierAccessor = context .getRequiredPersistentEntity (domainType )
267
267
.getIdentifierAccessor (aggregateRoot );
@@ -272,16 +272,16 @@ public <S> void delete(S aggregateRoot, Class<S> domainType) {
272
272
@ Override
273
273
public <S > void deleteById (Object id , Class <S > domainType ) {
274
274
275
- Assert .notNull (id , "Id must not be null! " );
276
- Assert .notNull (domainType , "Domain type must not be null! " );
275
+ Assert .notNull (id , "Id must not be null" );
276
+ Assert .notNull (domainType , "Domain type must not be null" );
277
277
278
278
deleteTree (id , null , domainType );
279
279
}
280
280
281
281
@ Override
282
282
public <T > void deleteAllById (Iterable <?> ids , Class <T > domainType ) {
283
283
284
- Assert .isTrue (ids .iterator ().hasNext (), "Ids must not be empty! " );
284
+ Assert .isTrue (ids .iterator ().hasNext (), "Ids must not be empty" );
285
285
286
286
BatchingAggregateChange <T , DeleteAggregateChange <T >> batchingAggregateChange = BatchingAggregateChange
287
287
.forDelete (domainType );
@@ -301,7 +301,7 @@ public <T> void deleteAllById(Iterable<?> ids, Class<T> domainType) {
301
301
@ Override
302
302
public void deleteAll (Class <?> domainType ) {
303
303
304
- Assert .notNull (domainType , "Domain type must not be null! " );
304
+ Assert .notNull (domainType , "Domain type must not be null" );
305
305
306
306
MutableAggregateChange <?> change = createDeletingChange (domainType );
307
307
executor .executeDelete (change );
@@ -310,7 +310,7 @@ public void deleteAll(Class<?> domainType) {
310
310
@ Override
311
311
public <T > void deleteAll (Iterable <? extends T > instances , Class <T > domainType ) {
312
312
313
- Assert .isTrue (instances .iterator ().hasNext (), "Aggregate instances must not be empty! " );
313
+ Assert .isTrue (instances .iterator ().hasNext (), "Aggregate instances must not be empty" );
314
314
315
315
BatchingAggregateChange <T , DeleteAggregateChange <T >> batchingAggregateChange = BatchingAggregateChange
316
316
.forDelete (domainType );
@@ -335,14 +335,14 @@ private <T> T afterExecute(AggregateChange<T> change, T entityAfterExecution) {
335
335
Object identifier = context .getRequiredPersistentEntity (change .getEntityType ())
336
336
.getIdentifierAccessor (entityAfterExecution ).getIdentifier ();
337
337
338
- Assert .notNull (identifier , "After saving the identifier must not be null! " );
338
+ Assert .notNull (identifier , "After saving the identifier must not be null" );
339
339
340
340
return triggerAfterSave (entityAfterExecution , change );
341
341
}
342
342
343
343
private <T > RootAggregateChange <T > beforeExecute (T aggregateRoot , Function <T , RootAggregateChange <T >> changeCreator ) {
344
344
345
- Assert .notNull (aggregateRoot , "Aggregate instance must not be null! " );
345
+ Assert .notNull (aggregateRoot , "Aggregate instance must not be null" );
346
346
347
347
aggregateRoot = triggerBeforeConvert (aggregateRoot );
348
348
@@ -375,7 +375,7 @@ private <T> T performSave(T instance, Function<T, RootAggregateChange<T>> change
375
375
376
376
Iterator <T > afterExecutionIterator = executor .executeSave (batchingAggregateChange ).iterator ();
377
377
378
- Assert .isTrue (afterExecutionIterator .hasNext (), "Instances after execution must not be empty! " );
378
+ Assert .isTrue (afterExecutionIterator .hasNext (), "Instances after execution must not be empty" );
379
379
380
380
return afterExecute (batchingAggregateChange , afterExecutionIterator .next ());
381
381
}
0 commit comments