DATAMONGO-1444 - Accept Collection and subtypes in ReactiveMongoOperations.insertAll(…).
This commit is contained in:
committed by
Oliver Gierke
parent
474af92075
commit
af4f0e0913
@@ -600,7 +600,7 @@ public interface ReactiveMongoOperations {
|
||||
* @param entityClass class that determines the collection to use
|
||||
* @return
|
||||
*/
|
||||
<T> Flux<T> insertAll(Mono<Collection<? extends T>> batchToSave, Class<?> entityClass);
|
||||
<T> Flux<T> insertAll(Mono<? extends Collection<? extends T>> batchToSave, Class<?> entityClass);
|
||||
|
||||
/**
|
||||
* Insert objects into the specified collection in a single batch write to the database.
|
||||
@@ -609,7 +609,7 @@ public interface ReactiveMongoOperations {
|
||||
* @param collectionName name of the collection to store the object in
|
||||
* @return
|
||||
*/
|
||||
<T> Flux<T> insertAll(Mono<Collection<? extends T>> batchToSave, String collectionName);
|
||||
<T> Flux<T> insertAll(Mono<? extends Collection<? extends T>> batchToSave, String collectionName);
|
||||
|
||||
/**
|
||||
* Insert a mixed Collection of objects into a database collection determining the collection name to use based on the
|
||||
@@ -618,7 +618,7 @@ public interface ReactiveMongoOperations {
|
||||
* @param objectsToSave the publisher which provides objects to save.
|
||||
* @return
|
||||
*/
|
||||
<T> Flux<T> insertAll(Mono<Collection<? extends T>> objectsToSave);
|
||||
<T> Flux<T> insertAll(Mono<? extends Collection<? extends T>> objectsToSave);
|
||||
|
||||
/**
|
||||
* Save the object to the collection for the entity type of the object to save. This will perform an insert if the
|
||||
|
||||
@@ -617,7 +617,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
return doFindOne(collectionName, new Document(idKey, id), null, entityClass);
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#geoNear(org.springframework.data.mongodb.core.query.NearQuery, java.lang.Class)
|
||||
*/
|
||||
@@ -626,7 +626,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
return geoNear(near, entityClass, determineCollectionName(entityClass));
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#geoNear(org.springframework.data.mongodb.core.query.NearQuery, java.lang.Class, java.lang.String)
|
||||
*/
|
||||
@@ -769,7 +769,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#insert(org.reactivestreams.Publisher, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T> Flux<T> insertAll(Mono<Collection<? extends T>> batchToSave, Class<?> entityClass) {
|
||||
public <T> Flux<T> insertAll(Mono<? extends Collection<? extends T>> batchToSave, Class<?> entityClass) {
|
||||
return insertAll(batchToSave, determineCollectionName(entityClass));
|
||||
}
|
||||
|
||||
@@ -777,7 +777,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#insert(org.reactivestreams.Publisher, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public <T> Flux<T> insertAll(Mono<Collection<? extends T>> batchToSave, String collectionName) {
|
||||
public <T> Flux<T> insertAll(Mono<? extends Collection<? extends T>> batchToSave, String collectionName) {
|
||||
return Flux.from(batchToSave).flatMap(collection -> insert(collection, collectionName));
|
||||
}
|
||||
|
||||
@@ -847,7 +847,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#insertAll(org.reactivestreams.Publisher)
|
||||
*/
|
||||
@Override
|
||||
public <T> Flux<T> insertAll(Mono<Collection<? extends T>> objectsToSave) {
|
||||
public <T> Flux<T> insertAll(Mono<? extends Collection<? extends T>> objectsToSave) {
|
||||
return Flux.from(objectsToSave).flatMap(this::insertAll);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user