1
1
/*
2
- * Copyright 2015 the original author or authors.
2
+ * Copyright 2015-2016 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
22
22
import org .springframework .dao .support .PersistenceExceptionTranslator ;
23
23
import org .springframework .data .mongodb .core .query .Query ;
24
24
import org .springframework .data .mongodb .core .query .Update ;
25
- import org .springframework .data .util .Tuple ;
25
+ import org .springframework .data .util .Pair ;
26
26
import org .springframework .util .Assert ;
27
27
28
28
import com .mongodb .BulkWriteException ;
@@ -148,19 +148,19 @@ public BulkOperations updateOne(Query query, Update update) {
148
148
Assert .notNull (query , "Query must not be null!" );
149
149
Assert .notNull (update , "Update must not be null!" );
150
150
151
- return updateOne (Arrays .asList (Tuple .of (query , update )));
151
+ return updateOne (Arrays .asList (Pair .of (query , update )));
152
152
}
153
153
154
154
/*
155
155
* (non-Javadoc)
156
156
* @see org.springframework.data.mongodb.core.BulkOperations#updateOne(java.util.List)
157
157
*/
158
158
@ Override
159
- public BulkOperations updateOne (List <Tuple <Query , Update >> updates ) {
159
+ public BulkOperations updateOne (List <Pair <Query , Update >> updates ) {
160
160
161
161
Assert .notNull (updates , "Updates must not be null!" );
162
162
163
- for (Tuple <Query , Update > update : updates ) {
163
+ for (Pair <Query , Update > update : updates ) {
164
164
update (update .getFirst (), update .getSecond (), false , false );
165
165
}
166
166
@@ -178,19 +178,19 @@ public BulkOperations updateMulti(Query query, Update update) {
178
178
Assert .notNull (query , "Query must not be null!" );
179
179
Assert .notNull (update , "Update must not be null!" );
180
180
181
- return updateMulti (Arrays .asList (Tuple .of (query , update )));
181
+ return updateMulti (Arrays .asList (Pair .of (query , update )));
182
182
}
183
183
184
184
/*
185
185
* (non-Javadoc)
186
186
* @see org.springframework.data.mongodb.core.BulkOperations#updateMulti(java.util.List)
187
187
*/
188
188
@ Override
189
- public BulkOperations updateMulti (List <Tuple <Query , Update >> updates ) {
189
+ public BulkOperations updateMulti (List <Pair <Query , Update >> updates ) {
190
190
191
191
Assert .notNull (updates , "Updates must not be null!" );
192
192
193
- for (Tuple <Query , Update > update : updates ) {
193
+ for (Pair <Query , Update > update : updates ) {
194
194
update (update .getFirst (), update .getSecond (), false , true );
195
195
}
196
196
@@ -211,9 +211,9 @@ public BulkOperations upsert(Query query, Update update) {
211
211
* @see org.springframework.data.mongodb.core.BulkOperations#upsert(java.util.List)
212
212
*/
213
213
@ Override
214
- public BulkOperations upsert (List <Tuple <Query , Update >> updates ) {
214
+ public BulkOperations upsert (List <Pair <Query , Update >> updates ) {
215
215
216
- for (Tuple <Query , Update > update : updates ) {
216
+ for (Pair <Query , Update > update : updates ) {
217
217
upsert (update .getFirst (), update .getSecond ());
218
218
}
219
219
0 commit comments