@@ -756,6 +756,8 @@ <T> Mono<T> findAndModify(Query query, UpdateDefinition update, FindAndModifyOpt
756
756
* fields specification. Must not be {@literal null}.
757
757
* @param replacement the replacement document. Must not be {@literal null}.
758
758
* @return the converted object that was updated or {@link Mono#empty()}, if not found.
759
+ * @throws org.springframework.data.mapping.MappingException if the collection name cannot be
760
+ * {@link #getCollectionName(Class) derived} from the given replacement value.
759
761
* @since 2.1
760
762
*/
761
763
default <T > Mono <T > findAndReplace (Query query , T replacement ) {
@@ -795,6 +797,8 @@ default <T> Mono<T> findAndReplace(Query query, T replacement, String collection
795
797
* @return the converted object that was updated or {@link Mono#empty()}, if not found. Depending on the value of
796
798
* {@link FindAndReplaceOptions#isReturnNew()} this will either be the object as it was before the update or
797
799
* as it is after the update.
800
+ * @throws org.springframework.data.mapping.MappingException if the collection name cannot be
801
+ * {@link #getCollectionName(Class) derived} from the given replacement value.
798
802
* @since 2.1
799
803
*/
800
804
default <T > Mono <T > findAndReplace (Query query , T replacement , FindAndReplaceOptions options ) {
@@ -865,6 +869,8 @@ default <T> Mono<T> findAndReplace(Query query, T replacement, FindAndReplaceOpt
865
869
* @return the converted object that was updated or {@link Mono#empty()}, if not found. Depending on the value of
866
870
* {@link FindAndReplaceOptions#isReturnNew()} this will either be the object as it was before the update or
867
871
* as it is after the update.
872
+ * @throws org.springframework.data.mapping.MappingException if the collection name cannot be
873
+ * {@link #getCollectionName(Class) derived} from the given replacement value.
868
874
* @since 2.1
869
875
*/
870
876
default <S , T > Mono <T > findAndReplace (Query query , S replacement , FindAndReplaceOptions options , Class <S > entityType ,
@@ -951,6 +957,8 @@ <S, T> Mono<T> findAndReplace(Query query, S replacement, FindAndReplaceOptions
951
957
* {@literal null}.
952
958
* @param entityClass class that determines the collection to use. Must not be {@literal null}.
953
959
* @return the count of matching documents.
960
+ * @throws org.springframework.data.mapping.MappingException if the collection name cannot be
961
+ * {@link #getCollectionName(Class) derived} from the given type.
954
962
*/
955
963
Mono <Long > count (Query query , Class <?> entityClass );
956
964
@@ -1007,6 +1015,8 @@ <S, T> Mono<T> findAndReplace(Query query, S replacement, FindAndReplaceOptions
1007
1015
*
1008
1016
* @param entityClass must not be {@literal null}.
1009
1017
* @return a {@link Mono} emitting the estimated number of documents.
1018
+ * @throws org.springframework.data.mapping.MappingException if the collection name cannot be
1019
+ * {@link #getCollectionName(Class) derived} from the given type.
1010
1020
* @since 3.1
1011
1021
*/
1012
1022
default Mono <Long > estimatedCount (Class <?> entityClass ) {
@@ -1045,6 +1055,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
1045
1055
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
1046
1056
* @return the inserted object.
1047
1057
* @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
1058
+ * @throws org.springframework.data.mapping.MappingException if the target collection name cannot be
1059
+ * {@link #getCollectionName(Class) derived} from the given object type.
1048
1060
*/
1049
1061
<T > Mono <T > insert (T objectToSave );
1050
1062
@@ -1070,7 +1082,9 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
1070
1082
*
1071
1083
* @param batchToSave the batch of objects to save. Must not be {@literal null}.
1072
1084
* @param entityClass class that determines the collection to use. Must not be {@literal null}.
1073
- * @return the inserted objects .
1085
+ * @return the inserted objects.
1086
+ * @throws org.springframework.data.mapping.MappingException if the target collection name cannot be
1087
+ * {@link #getCollectionName(Class) derived} from the given type.
1074
1088
*/
1075
1089
<T > Flux <T > insert (Collection <? extends T > batchToSave , Class <?> entityClass );
1076
1090
@@ -1089,6 +1103,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
1089
1103
*
1090
1104
* @param objectsToSave the list of objects to save. Must not be {@literal null}.
1091
1105
* @return the saved objects.
1106
+ * @throws org.springframework.data.mapping.MappingException if the target collection name cannot be
1107
+ * {@link #getCollectionName(Class) derived} for the given objects.
1092
1108
*/
1093
1109
<T > Flux <T > insertAll (Collection <? extends T > objectsToSave );
1094
1110
@@ -1116,6 +1132,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
1116
1132
* @param batchToSave the publisher which provides objects to save. Must not be {@literal null}.
1117
1133
* @param entityClass class that determines the collection to use. Must not be {@literal null}.
1118
1134
* @return the inserted objects.
1135
+ * @throws org.springframework.data.mapping.MappingException if the target collection name cannot be
1136
+ * {@link #getCollectionName(Class) derived} for the type.
1119
1137
*/
1120
1138
<T > Flux <T > insertAll (Mono <? extends Collection <? extends T >> batchToSave , Class <?> entityClass );
1121
1139
@@ -1155,6 +1173,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
1155
1173
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
1156
1174
* @return the saved object.
1157
1175
* @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
1176
+ * @throws org.springframework.data.mapping.MappingException if the target collection name cannot be
1177
+ * {@link #getCollectionName(Class) derived} from the given object type.
1158
1178
*/
1159
1179
<T > Mono <T > save (T objectToSave );
1160
1180
@@ -1191,6 +1211,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
1191
1211
*
1192
1212
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
1193
1213
* @return the saved object.
1214
+ * @throws org.springframework.data.mapping.MappingException if the target collection name cannot be
1215
+ * {@link #getCollectionName(Class) derived} from the given object type.
1194
1216
*/
1195
1217
<T > Mono <T > save (Mono <? extends T > objectToSave );
1196
1218
@@ -1224,6 +1246,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
1224
1246
* the existing object. Must not be {@literal null}.
1225
1247
* @param entityClass class that determines the collection to use. Must not be {@literal null}.
1226
1248
* @return the {@link UpdateResult} which lets you access the results of the previous write.
1249
+ * @throws org.springframework.data.mapping.MappingException if the target collection name cannot be
1250
+ * {@link #getCollectionName(Class) derived} from the given type.
1227
1251
* @since 3.0
1228
1252
* @see Update
1229
1253
* @see AggregationUpdate
@@ -1278,6 +1302,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
1278
1302
* the existing. Must not be {@literal null}.
1279
1303
* @param entityClass class that determines the collection to use.
1280
1304
* @return the {@link UpdateResult} which lets you access the results of the previous write.
1305
+ * @throws org.springframework.data.mapping.MappingException if the target collection name cannot be
1306
+ * {@link #getCollectionName(Class) derived} from the given type.
1281
1307
* @since 3.0
1282
1308
* @see Update
1283
1309
* @see AggregationUpdate
@@ -1333,6 +1359,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
1333
1359
* @param entityClass class of the pojo to be operated on. Must not be {@literal null}.
1334
1360
* @return the {@link UpdateResult} which lets you access the results of the previous write.
1335
1361
* @since 3.0
1362
+ * @throws org.springframework.data.mapping.MappingException if the target collection name cannot be
1363
+ * {@link #getCollectionName(Class) derived} from the given type.
1336
1364
* @see Update
1337
1365
* @see AggregationUpdate
1338
1366
*/
@@ -1379,6 +1407,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
1379
1407
*
1380
1408
* @param object must not be {@literal null}.
1381
1409
* @return the {@link DeleteResult} which lets you access the results of the previous delete.
1410
+ * @throws org.springframework.data.mapping.MappingException if the target collection name cannot be
1411
+ * {@link #getCollectionName(Class) derived} from the given object type.
1382
1412
*/
1383
1413
Mono <DeleteResult > remove (Object object );
1384
1414
@@ -1396,6 +1426,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
1396
1426
*
1397
1427
* @param objectToRemove must not be {@literal null}.
1398
1428
* @return the {@link DeleteResult} which lets you access the results of the previous delete.
1429
+ * @throws org.springframework.data.mapping.MappingException if the target collection name cannot be
1430
+ * {@link #getCollectionName(Class) derived} from the given object type.
1399
1431
*/
1400
1432
Mono <DeleteResult > remove (Mono <? extends Object > objectToRemove );
1401
1433
@@ -1415,6 +1447,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
1415
1447
* @param query the query document that specifies the criteria used to remove a record.
1416
1448
* @param entityClass class that determines the collection to use.
1417
1449
* @return the {@link DeleteResult} which lets you access the results of the previous delete.
1450
+ * @throws org.springframework.data.mapping.MappingException if the target collection name cannot be
1451
+ * {@link #getCollectionName(Class) derived} from the given type.
1418
1452
*/
1419
1453
Mono <DeleteResult > remove (Query query , Class <?> entityClass );
1420
1454
@@ -1458,6 +1492,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
1458
1492
* @param query the query document that specifies the criteria used to find and remove documents.
1459
1493
* @param entityClass class of the pojo to be operated on.
1460
1494
* @return the {@link Flux} converted objects deleted by this operation.
1495
+ * @throws org.springframework.data.mapping.MappingException if the target collection name cannot be
1496
+ * {@link #getCollectionName(Class) derived} from the given type.
1461
1497
*/
1462
1498
<T > Flux <T > findAllAndRemove (Query query , Class <T > entityClass );
1463
1499
@@ -1489,6 +1525,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
1489
1525
* specification.
1490
1526
* @param entityClass the parametrized type of the returned {@link Flux}.
1491
1527
* @return the {@link Flux} of converted objects.
1528
+ * @throws org.springframework.data.mapping.MappingException if the target collection name cannot be
1529
+ * {@link #getCollectionName(Class) derived} from the given type.
1492
1530
*/
1493
1531
<T > Flux <T > tail (Query query , Class <T > entityClass );
1494
1532
@@ -1633,6 +1671,7 @@ <T> Flux<T> mapReduce(Query filterQuery, Class<?> domainType, String inputCollec
1633
1671
*
1634
1672
* @param entityClass must not be {@literal null}.
1635
1673
* @return never {@literal null}.
1674
+ * @throws org.springframework.data.mapping.MappingException if the collection name cannot be derived from the type.
1636
1675
* @since 2.1
1637
1676
*/
1638
1677
String getCollectionName (Class <?> entityClass );
0 commit comments