Skip to content

Commit a7d865e

Browse files
committed
Polishing.
Update Javadoc. Closes #3570. Original pull request: #3576.
1 parent cde3900 commit a7d865e

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java

+10-6
Original file line numberDiff line numberDiff line change
@@ -1258,11 +1258,13 @@ default long estimatedCount(Class<?> entityClass) {
12581258
* <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation" > Spring's
12591259
* Type Conversion"</a> for more details.
12601260
* <p/>
1261-
* <p/>
12621261
* Insert is used to initially store the object into the database. To update an existing object use the save method.
1262+
* <p/>
1263+
* The {@code objectToSave} must not be collection-like.
12631264
*
12641265
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
12651266
* @return the inserted object.
1267+
* @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
12661268
*/
12671269
<T> T insert(T objectToSave);
12681270

@@ -1273,10 +1275,13 @@ default long estimatedCount(Class<?> entityClass) {
12731275
* configured otherwise, an instance of {@link MappingMongoConverter} will be used.
12741276
* <p/>
12751277
* Insert is used to initially store the object into the database. To update an existing object use the save method.
1278+
* <p/>
1279+
* The {@code objectToSave} must not be collection-like.
12761280
*
12771281
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
12781282
* @param collectionName name of the collection to store the object in. Must not be {@literal null}.
12791283
* @return the inserted object.
1284+
* @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
12801285
*/
12811286
<T> T insert(T objectToSave, String collectionName);
12821287

@@ -1320,11 +1325,11 @@ default long estimatedCount(Class<?> entityClass) {
13201325
* <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation" > Spring's
13211326
* Type Conversion"</a> for more details.
13221327
* <p />
1323-
* The {@literal objectToSave} must not be collection like.
1328+
* The {@code objectToSave} must not be collection-like.
13241329
*
13251330
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
13261331
* @return the saved object.
1327-
* @throws IllegalArgumentException in case the objectToSave is collection like.
1332+
* @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
13281333
*/
13291334
<T> T save(T objectToSave);
13301335

@@ -1341,13 +1346,12 @@ default long estimatedCount(Class<?> entityClass) {
13411346
* https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation">Spring's Type
13421347
* Conversion"</a> for more details.
13431348
* <p />
1344-
* The {@literal objectToSave} must not be collection like.
1345-
*
1349+
* The {@code objectToSave} must not be collection-like.
13461350
*
13471351
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
13481352
* @param collectionName name of the collection to store the object in. Must not be {@literal null}.
13491353
* @return the saved object.
1350-
* @throws IllegalArgumentException in case the objectToSave is collection like.
1354+
* @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
13511355
*/
13521356
<T> T save(T objectToSave, String collectionName);
13531357

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java

+10-2
Original file line numberDiff line numberDiff line change
@@ -1038,11 +1038,13 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
10381038
* <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation" > Spring's
10391039
* Type Conversion"</a> for more details.
10401040
* <p/>
1041-
* <p/>
10421041
* Insert is used to initially store the object into the database. To update an existing object use the save method.
1042+
* <p />
1043+
* The {@code objectToSave} must not be collection-like.
10431044
*
10441045
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
10451046
* @return the inserted object.
1047+
* @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
10461048
*/
10471049
<T> Mono<T> insert(T objectToSave);
10481050

@@ -1053,10 +1055,13 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
10531055
* configured otherwise, an instance of {@link MappingMongoConverter} will be used.
10541056
* <p/>
10551057
* Insert is used to initially store the object into the database. To update an existing object use the save method.
1058+
* <p />
1059+
* The {@code objectToSave} must not be collection-like.
10561060
*
10571061
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
10581062
* @param collectionName name of the collection to store the object in. Must not be {@literal null}.
10591063
* @return the inserted object.
1064+
* @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
10601065
*/
10611066
<T> Mono<T> insert(T objectToSave, String collectionName);
10621067

@@ -1098,7 +1103,6 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
10981103
* <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation" > Spring's
10991104
* Type Conversion"</a> for more details.
11001105
* <p/>
1101-
* <p/>
11021106
* Insert is used to initially store the object into the database. To update an existing object use the save method.
11031107
*
11041108
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
@@ -1145,9 +1149,12 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
11451149
* property type will be handled by Spring's BeanWrapper class that leverages Type Conversion API. See
11461150
* <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#validation" > Spring's
11471151
* Type Conversion"</a> for more details.
1152+
* <p />
1153+
* The {@code objectToSave} must not be collection-like.
11481154
*
11491155
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
11501156
* @return the saved object.
1157+
* @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
11511158
*/
11521159
<T> Mono<T> save(T objectToSave);
11531160

@@ -1167,6 +1174,7 @@ default Mono<Long> estimatedCount(Class<?> entityClass) {
11671174
* @param objectToSave the object to store in the collection. Must not be {@literal null}.
11681175
* @param collectionName name of the collection to store the object in. Must not be {@literal null}.
11691176
* @return the saved object.
1177+
* @throws IllegalArgumentException in case the {@code objectToSave} is collection-like.
11701178
*/
11711179
<T> Mono<T> save(T objectToSave, String collectionName);
11721180

0 commit comments

Comments
 (0)