@@ -756,6 +756,8 @@ <T> Mono<T> findAndModify(Query query, UpdateDefinition update, FindAndModifyOpt
756756 * fields specification. Must not be {@literal null}.
757757 * @param replacement the replacement document. Must not be {@literal null}.
758758 * @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.
759761 * @since 2.1
760762 */
761763 default <T > Mono <T > findAndReplace (Query query , T replacement ) {
@@ -795,6 +797,8 @@ default <T> Mono<T> findAndReplace(Query query, T replacement, String collection
795797 * @return the converted object that was updated or {@link Mono#empty()}, if not found. Depending on the value of
796798 * {@link FindAndReplaceOptions#isReturnNew()} this will either be the object as it was before the update or
797799 * 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.
798802 * @since 2.1
799803 */
800804 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
865869 * @return the converted object that was updated or {@link Mono#empty()}, if not found. Depending on the value of
866870 * {@link FindAndReplaceOptions#isReturnNew()} this will either be the object as it was before the update or
867871 * 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.
868874 * @since 2.1
869875 */
870876 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
951957 * {@literal null}.
952958 * @param entityClass class that determines the collection to use. Must not be {@literal null}.
953959 * @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.
954962 */
955963 Mono <Long > count (Query query , Class <?> entityClass );
956964
@@ -1007,6 +1015,8 @@ <S, T> Mono<T> findAndReplace(Query query, S replacement, FindAndReplaceOptions
10071015 *
10081016 * @param entityClass must not be {@literal null}.
10091017 * @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.
10101020 * @since 3.1
10111021 */
10121022 default Mono <Long > estimatedCount (Class <?> entityClass ) {
@@ -1045,6 +1055,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
10451055 * @param objectToSave the object to store in the collection. Must not be {@literal null}.
10461056 * @return the inserted object.
10471057 * @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.
10481060 */
10491061 <T > Mono <T > insert (T objectToSave );
10501062
@@ -1070,7 +1082,9 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
10701082 *
10711083 * @param batchToSave the batch of objects to save. Must not be {@literal null}.
10721084 * @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.
10741088 */
10751089 <T > Flux <T > insert (Collection <? extends T > batchToSave , Class <?> entityClass );
10761090
@@ -1089,6 +1103,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
10891103 *
10901104 * @param objectsToSave the list of objects to save. Must not be {@literal null}.
10911105 * @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.
10921108 */
10931109 <T > Flux <T > insertAll (Collection <? extends T > objectsToSave );
10941110
@@ -1116,6 +1132,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
11161132 * @param batchToSave the publisher which provides objects to save. Must not be {@literal null}.
11171133 * @param entityClass class that determines the collection to use. Must not be {@literal null}.
11181134 * @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.
11191137 */
11201138 <T > Flux <T > insertAll (Mono <? extends Collection <? extends T >> batchToSave , Class <?> entityClass );
11211139
@@ -1155,6 +1173,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
11551173 * @param objectToSave the object to store in the collection. Must not be {@literal null}.
11561174 * @return the saved object.
11571175 * @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.
11581178 */
11591179 <T > Mono <T > save (T objectToSave );
11601180
@@ -1191,6 +1211,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
11911211 *
11921212 * @param objectToSave the object to store in the collection. Must not be {@literal null}.
11931213 * @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.
11941216 */
11951217 <T > Mono <T > save (Mono <? extends T > objectToSave );
11961218
@@ -1224,6 +1246,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
12241246 * the existing object. Must not be {@literal null}.
12251247 * @param entityClass class that determines the collection to use. Must not be {@literal null}.
12261248 * @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.
12271251 * @since 3.0
12281252 * @see Update
12291253 * @see AggregationUpdate
@@ -1278,6 +1302,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
12781302 * the existing. Must not be {@literal null}.
12791303 * @param entityClass class that determines the collection to use.
12801304 * @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.
12811307 * @since 3.0
12821308 * @see Update
12831309 * @see AggregationUpdate
@@ -1333,6 +1359,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
13331359 * @param entityClass class of the pojo to be operated on. Must not be {@literal null}.
13341360 * @return the {@link UpdateResult} which lets you access the results of the previous write.
13351361 * @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.
13361364 * @see Update
13371365 * @see AggregationUpdate
13381366 */
@@ -1379,6 +1407,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
13791407 *
13801408 * @param object must not be {@literal null}.
13811409 * @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.
13821412 */
13831413 Mono <DeleteResult > remove (Object object );
13841414
@@ -1396,6 +1426,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
13961426 *
13971427 * @param objectToRemove must not be {@literal null}.
13981428 * @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.
13991431 */
14001432 Mono <DeleteResult > remove (Mono <? extends Object > objectToRemove );
14011433
@@ -1415,6 +1447,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
14151447 * @param query the query document that specifies the criteria used to remove a record.
14161448 * @param entityClass class that determines the collection to use.
14171449 * @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.
14181452 */
14191453 Mono <DeleteResult > remove (Query query , Class <?> entityClass );
14201454
@@ -1458,6 +1492,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
14581492 * @param query the query document that specifies the criteria used to find and remove documents.
14591493 * @param entityClass class of the pojo to be operated on.
14601494 * @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.
14611497 */
14621498 <T > Flux <T > findAllAndRemove (Query query , Class <T > entityClass );
14631499
@@ -1489,6 +1525,8 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
14891525 * specification.
14901526 * @param entityClass the parametrized type of the returned {@link Flux}.
14911527 * @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.
14921530 */
14931531 <T > Flux <T > tail (Query query , Class <T > entityClass );
14941532
@@ -1633,6 +1671,7 @@ <T> Flux<T> mapReduce(Query filterQuery, Class<?> domainType, String inputCollec
16331671 *
16341672 * @param entityClass must not be {@literal null}.
16351673 * @return never {@literal null}.
1674+ * @throws org.springframework.data.mapping.MappingException if the collection name cannot be derived from the type.
16361675 * @since 2.1
16371676 */
16381677 String getCollectionName (Class <?> entityClass );
0 commit comments