Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e704f147ad | ||
|
|
67ea27d9e4 | ||
|
|
a9ed00530f | ||
|
|
75f73756c9 | ||
|
|
4b137cfd55 | ||
|
|
762aa62b2a | ||
|
|
8f4a8dcbee | ||
|
|
0aa92031a3 | ||
|
|
8aa52c129c | ||
|
|
03ac725080 | ||
|
|
5258b36080 | ||
|
|
ddbec07643 | ||
|
|
f4375fc54d | ||
|
|
ccbd18ff6a | ||
|
|
490ef81d7b | ||
|
|
92668635b1 |
4
.mvn/wrapper/maven-wrapper.properties
vendored
4
.mvn/wrapper/maven-wrapper.properties
vendored
@@ -1,2 +1,2 @@
|
||||
#Mon Oct 11 14:30:24 CEST 2021
|
||||
distributionUrl=https\://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.3/apache-maven-3.8.3-bin.zip
|
||||
#Tue Feb 22 13:56:07 CET 2022
|
||||
distributionUrl=https\://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
|
||||
|
||||
12
Jenkinsfile
vendored
12
Jenkinsfile
vendored
@@ -112,7 +112,7 @@ pipeline {
|
||||
}
|
||||
options { timeout(time: 30, unit: 'MINUTES') }
|
||||
environment {
|
||||
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
|
||||
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
@@ -145,7 +145,7 @@ pipeline {
|
||||
}
|
||||
options { timeout(time: 30, unit: 'MINUTES') }
|
||||
environment {
|
||||
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
|
||||
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
@@ -169,7 +169,7 @@ pipeline {
|
||||
}
|
||||
options { timeout(time: 30, unit: 'MINUTES') }
|
||||
environment {
|
||||
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
|
||||
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
@@ -193,7 +193,7 @@ pipeline {
|
||||
}
|
||||
options { timeout(time: 30, unit: 'MINUTES') }
|
||||
environment {
|
||||
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
|
||||
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
@@ -204,7 +204,7 @@ pipeline {
|
||||
sh 'sleep 10'
|
||||
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
|
||||
sh 'sleep 15'
|
||||
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pjava11 clean dependency:list test -Duser.name=jenkins -Dsort -U -B'
|
||||
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean dependency:list test -Duser.name=jenkins -Dsort -U -B'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -227,7 +227,7 @@ pipeline {
|
||||
options { timeout(time: 20, unit: 'MINUTES') }
|
||||
|
||||
environment {
|
||||
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
|
||||
ARTIFACTORY = credentials("${p['artifactory.credentials']}")
|
||||
}
|
||||
|
||||
steps {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Java versions
|
||||
java.main.tag=8u312-b07-jdk
|
||||
java.next.tag=11.0.13_8-jdk
|
||||
java.lts.tag=17.0.1_12-jdk
|
||||
java.main.tag=8u322-b06-jdk
|
||||
java.next.tag=11.0.14.1_1-jdk
|
||||
java.lts.tag=17.0.2_8-jdk
|
||||
|
||||
# Docker container images - standard
|
||||
docker.java.main.image=harbor-repo.vmware.com/dockerhub-proxy-cache/library/eclipse-temurin:${java.main.tag}
|
||||
@@ -9,15 +9,15 @@ docker.java.next.image=harbor-repo.vmware.com/dockerhub-proxy-cache/library/ecli
|
||||
docker.java.lts.image=harbor-repo.vmware.com/dockerhub-proxy-cache/library/eclipse-temurin:${java.lts.tag}
|
||||
|
||||
# Supported versions of MongoDB
|
||||
docker.mongodb.4.0.version=4.0.23
|
||||
docker.mongodb.4.4.version=4.4.4
|
||||
docker.mongodb.5.0.version=5.0.3
|
||||
docker.mongodb.4.0.version=4.0.28
|
||||
docker.mongodb.4.4.version=4.4.12
|
||||
docker.mongodb.5.0.version=5.0.6
|
||||
|
||||
# Supported versions of Redis
|
||||
docker.redis.6.version=6.2.4
|
||||
docker.redis.6.version=6.2.6
|
||||
|
||||
# Supported versions of Cassandra
|
||||
docker.cassandra.3.version=3.11.10
|
||||
docker.cassandra.3.version=3.11.12
|
||||
|
||||
# Docker environment settings
|
||||
docker.java.inside.basic=-v $HOME:/tmp/jenkins-home
|
||||
|
||||
6
pom.xml
6
pom.xml
@@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-mongodb-parent</artifactId>
|
||||
<version>3.3.2</version>
|
||||
<version>3.3.4</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>Spring Data MongoDB</name>
|
||||
@@ -15,7 +15,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.data.build</groupId>
|
||||
<artifactId>spring-data-parent</artifactId>
|
||||
<version>2.6.2</version>
|
||||
<version>2.6.4</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
@@ -26,7 +26,7 @@
|
||||
<properties>
|
||||
<project.type>multi</project.type>
|
||||
<dist.id>spring-data-mongodb</dist.id>
|
||||
<springdata.commons>2.6.2</springdata.commons>
|
||||
<springdata.commons>2.6.4</springdata.commons>
|
||||
<mongo>4.4.2</mongo>
|
||||
<mongo.reactivestreams>${mongo}</mongo.reactivestreams>
|
||||
<jmh.version>1.19</jmh.version>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-mongodb-parent</artifactId>
|
||||
<version>3.3.2</version>
|
||||
<version>3.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-mongodb-parent</artifactId>
|
||||
<version>3.3.2</version>
|
||||
<version>3.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-mongodb-parent</artifactId>
|
||||
<version>3.3.2</version>
|
||||
<version>3.3.4</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -315,6 +315,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
|
||||
*/
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
|
||||
prepareIndexCreator(applicationContext);
|
||||
@@ -380,6 +381,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public MongoConverter getConverter() {
|
||||
return this.mongoConverter;
|
||||
}
|
||||
@@ -519,6 +521,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.MongoOperations#execute(org.springframework.data.mongodb.core.DbCallback)
|
||||
*/
|
||||
@Override
|
||||
public <T> T execute(DbCallback<T> action) {
|
||||
|
||||
Assert.notNull(action, "DbCallback must not be null!");
|
||||
@@ -535,6 +538,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.MongoOperations#execute(java.lang.Class, org.springframework.data.mongodb.core.DbCallback)
|
||||
*/
|
||||
@Override
|
||||
public <T> T execute(Class<?> entityClass, CollectionCallback<T> callback) {
|
||||
|
||||
Assert.notNull(entityClass, "EntityClass must not be null!");
|
||||
@@ -545,6 +549,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.MongoOperations#execute(java.lang.String, org.springframework.data.mongodb.core.DbCallback)
|
||||
*/
|
||||
@Override
|
||||
public <T> T execute(String collectionName, CollectionCallback<T> callback) {
|
||||
|
||||
Assert.notNull(collectionName, "CollectionName must not be null!");
|
||||
@@ -597,6 +602,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.MongoOperations#createCollection(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T> MongoCollection<Document> createCollection(Class<T> entityClass) {
|
||||
return createCollection(entityClass, operations.forType(entityClass).getCollectionOptions());
|
||||
}
|
||||
@@ -605,6 +611,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.MongoOperations#createCollection(java.lang.Class, org.springframework.data.mongodb.core.CollectionOptions)
|
||||
*/
|
||||
@Override
|
||||
public <T> MongoCollection<Document> createCollection(Class<T> entityClass,
|
||||
@Nullable CollectionOptions collectionOptions) {
|
||||
|
||||
@@ -623,6 +630,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.MongoOperations#createCollection(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public MongoCollection<Document> createCollection(String collectionName) {
|
||||
|
||||
Assert.notNull(collectionName, "CollectionName must not be null!");
|
||||
@@ -634,6 +642,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.MongoOperations#createCollection(java.lang.String, org.springframework.data.mongodb.core.CollectionOptions)
|
||||
*/
|
||||
@Override
|
||||
public MongoCollection<Document> createCollection(String collectionName,
|
||||
@Nullable CollectionOptions collectionOptions) {
|
||||
|
||||
@@ -645,6 +654,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.MongoOperations#getCollection(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
public MongoCollection<Document> getCollection(String collectionName) {
|
||||
|
||||
@@ -657,6 +667,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#getCollection(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T> boolean collectionExists(Class<T> entityClass) {
|
||||
return collectionExists(getCollectionName(entityClass));
|
||||
}
|
||||
@@ -665,6 +676,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#getCollection(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
public boolean collectionExists(String collectionName) {
|
||||
|
||||
@@ -685,6 +697,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#dropCollection(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T> void dropCollection(Class<T> entityClass) {
|
||||
dropCollection(getCollectionName(entityClass));
|
||||
}
|
||||
@@ -693,6 +706,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#dropCollection(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void dropCollection(String collectionName) {
|
||||
|
||||
Assert.notNull(collectionName, "CollectionName must not be null!");
|
||||
@@ -716,6 +730,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#indexOps(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public IndexOperations indexOps(String collectionName, @Nullable Class<?> type) {
|
||||
return new DefaultIndexOperations(this, collectionName, type);
|
||||
}
|
||||
@@ -724,6 +739,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#indexOps(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public IndexOperations indexOps(Class<?> entityClass) {
|
||||
return indexOps(getCollectionName(entityClass), entityClass);
|
||||
}
|
||||
@@ -732,6 +748,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#bulkOps(org.springframework.data.mongodb.core.BulkMode, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public BulkOperations bulkOps(BulkMode bulkMode, String collectionName) {
|
||||
return bulkOps(bulkMode, null, collectionName);
|
||||
}
|
||||
@@ -740,6 +757,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#bulkOps(org.springframework.data.mongodb.core.BulkMode, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public BulkOperations bulkOps(BulkMode bulkMode, Class<?> entityClass) {
|
||||
return bulkOps(bulkMode, entityClass, getCollectionName(entityClass));
|
||||
}
|
||||
@@ -748,6 +766,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#bulkOps(org.springframework.data.mongodb.core.BulkMode, java.lang.Class, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public BulkOperations bulkOps(BulkMode mode, @Nullable Class<?> entityType, String collectionName) {
|
||||
|
||||
Assert.notNull(mode, "BulkMode must not be null!");
|
||||
@@ -1109,6 +1128,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.MongoOperations#count(org.springframework.data.mongodb.core.query.Query, java.lang.Class, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public long count(Query query, @Nullable Class<?> entityClass, String collectionName) {
|
||||
|
||||
Assert.notNull(query, "Query must not be null!");
|
||||
@@ -1915,10 +1935,12 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
return mappedResults;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> GroupByResults<T> group(String inputCollectionName, GroupBy groupBy, Class<T> entityClass) {
|
||||
return group(null, inputCollectionName, groupBy, entityClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> GroupByResults<T> group(@Nullable Criteria criteria, String inputCollectionName, GroupBy groupBy,
|
||||
Class<T> entityClass) {
|
||||
|
||||
@@ -2325,6 +2347,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ExecutableInsertOperation#getCollectionNames()
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
public Set<String> getCollectionNames() {
|
||||
return execute(db -> {
|
||||
@@ -2974,6 +2997,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
this.collation = collation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FindIterable<Document> doInCollection(MongoCollection<Document> collection)
|
||||
throws MongoException, DataAccessException {
|
||||
|
||||
@@ -3033,6 +3057,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
this.collation = Optional.ofNullable(collation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Document doInCollection(MongoCollection<Document> collection) throws MongoException, DataAccessException {
|
||||
|
||||
FindOneAndDeleteOptions opts = new FindOneAndDeleteOptions().sort(sort).projection(fields);
|
||||
@@ -3062,6 +3087,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Document doInCollection(MongoCollection<Document> collection) throws MongoException, DataAccessException {
|
||||
|
||||
FindOneAndUpdateOptions opts = new FindOneAndUpdateOptions();
|
||||
@@ -3174,6 +3200,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
this.collectionName = collectionName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T doWith(Document document) {
|
||||
|
||||
maybeEmitEvent(new AfterLoadEvent<>(document, type, collectionName));
|
||||
@@ -3218,6 +3245,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.MongoTemplate.DocumentCallback#doWith(org.bson.Document)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public T doWith(Document document) {
|
||||
|
||||
@@ -3258,6 +3286,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.CursorPreparer#prepare(com.mongodb.DBCursor)
|
||||
*/
|
||||
@Override
|
||||
public FindIterable<Document> prepare(FindIterable<Document> iterable) {
|
||||
|
||||
FindIterable<Document> cursorToUse = iterable;
|
||||
@@ -3376,6 +3405,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
||||
this.metric = metric;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeoResult<T> doWith(Document object) {
|
||||
|
||||
double distance = Double.NaN;
|
||||
|
||||
@@ -340,6 +340,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
|
||||
*/
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
|
||||
prepareIndexCreator(applicationContext);
|
||||
@@ -406,6 +407,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public MongoConverter getConverter() {
|
||||
return this.mongoConverter;
|
||||
}
|
||||
@@ -414,6 +416,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#reactiveIndexOps(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public ReactiveIndexOperations indexOps(String collectionName) {
|
||||
return new DefaultReactiveIndexOperations(this, collectionName, this.queryMapper);
|
||||
}
|
||||
@@ -422,10 +425,12 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#reactiveIndexOps(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public ReactiveIndexOperations indexOps(Class<?> entityClass) {
|
||||
return new DefaultReactiveIndexOperations(this, getCollectionName(entityClass), this.queryMapper, entityClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCollectionName(Class<?> entityClass) {
|
||||
return operations.determineCollectionName(entityClass);
|
||||
}
|
||||
@@ -434,6 +439,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#executeCommand(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Mono<Document> executeCommand(String jsonCommand) {
|
||||
|
||||
Assert.notNull(jsonCommand, "Command must not be empty!");
|
||||
@@ -445,6 +451,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#executeCommand(org.bson.Document)
|
||||
*/
|
||||
@Override
|
||||
public Mono<Document> executeCommand(Document command) {
|
||||
return executeCommand(command, null);
|
||||
}
|
||||
@@ -453,6 +460,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#executeCommand(org.bson.Document, com.mongodb.ReadPreference)
|
||||
*/
|
||||
@Override
|
||||
public Mono<Document> executeCommand(Document command, @Nullable ReadPreference readPreference) {
|
||||
|
||||
Assert.notNull(command, "Command must not be null!");
|
||||
@@ -483,6 +491,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#execute(java.lang.String, org.springframework.data.mongodb.core.ReactiveCollectionCallback)
|
||||
*/
|
||||
@Override
|
||||
public <T> Flux<T> execute(String collectionName, ReactiveCollectionCallback<T> callback) {
|
||||
|
||||
Assert.notNull(callback, "ReactiveCollectionCallback must not be null!");
|
||||
@@ -580,6 +589,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#withSession(com.mongodb.session.ClientSession)
|
||||
*/
|
||||
@Override
|
||||
public ReactiveMongoOperations withSession(ClientSession session) {
|
||||
return new ReactiveSessionBoundMongoTemplate(session, ReactiveMongoTemplate.this);
|
||||
}
|
||||
@@ -665,6 +675,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#createCollection(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T> Mono<MongoCollection<Document>> createCollection(Class<T> entityClass) {
|
||||
return createCollection(entityClass, operations.forType(entityClass).getCollectionOptions());
|
||||
}
|
||||
@@ -673,6 +684,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#createCollection(java.lang.Class, org.springframework.data.mongodb.core.CollectionOptions)
|
||||
*/
|
||||
@Override
|
||||
public <T> Mono<MongoCollection<Document>> createCollection(Class<T> entityClass,
|
||||
@Nullable CollectionOptions collectionOptions) {
|
||||
|
||||
@@ -691,6 +703,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#createCollection(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Mono<MongoCollection<Document>> createCollection(String collectionName) {
|
||||
return doCreateCollection(collectionName, new CreateCollectionOptions());
|
||||
}
|
||||
@@ -699,6 +712,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#createCollection(java.lang.String, org.springframework.data.mongodb.core.CollectionOptions)
|
||||
*/
|
||||
@Override
|
||||
public Mono<MongoCollection<Document>> createCollection(String collectionName,
|
||||
@Nullable CollectionOptions collectionOptions) {
|
||||
return doCreateCollection(collectionName, convertToCreateCollectionOptions(collectionOptions));
|
||||
@@ -708,6 +722,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#getCollection(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Mono<MongoCollection<Document>> getCollection(String collectionName) {
|
||||
|
||||
Assert.notNull(collectionName, "Collection name must not be null!");
|
||||
@@ -719,6 +734,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#collectionExists(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T> Mono<Boolean> collectionExists(Class<T> entityClass) {
|
||||
return collectionExists(getCollectionName(entityClass));
|
||||
}
|
||||
@@ -727,6 +743,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#collectionExists(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Mono<Boolean> collectionExists(String collectionName) {
|
||||
return createMono(db -> Flux.from(db.listCollectionNames()) //
|
||||
.filter(s -> s.equals(collectionName)) //
|
||||
@@ -738,6 +755,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#dropCollection(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T> Mono<Void> dropCollection(Class<T> entityClass) {
|
||||
return dropCollection(getCollectionName(entityClass));
|
||||
}
|
||||
@@ -746,6 +764,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#dropCollection(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Mono<Void> dropCollection(String collectionName) {
|
||||
|
||||
return createMono(collectionName, MongoCollection::drop).doOnSuccess(success -> {
|
||||
@@ -759,6 +778,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#getCollectionNames()
|
||||
*/
|
||||
@Override
|
||||
public Flux<String> getCollectionNames() {
|
||||
return createFlux(MongoDatabase::listCollectionNames);
|
||||
}
|
||||
@@ -775,6 +795,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#findOne(org.springframework.data.mongodb.core.query.Query, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T> Mono<T> findOne(Query query, Class<T> entityClass) {
|
||||
return findOne(query, entityClass, getCollectionName(entityClass));
|
||||
}
|
||||
@@ -783,6 +804,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#findOne(org.springframework.data.mongodb.core.query.Query, java.lang.Class, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public <T> Mono<T> findOne(Query query, Class<T> entityClass, String collectionName) {
|
||||
|
||||
if (ObjectUtils.isEmpty(query.getSortObject())) {
|
||||
@@ -798,6 +820,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#exists(org.springframework.data.mongodb.core.query.Query, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public Mono<Boolean> exists(Query query, Class<?> entityClass) {
|
||||
return exists(query, entityClass, getCollectionName(entityClass));
|
||||
}
|
||||
@@ -806,6 +829,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#exists(org.springframework.data.mongodb.core.query.Query, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Mono<Boolean> exists(Query query, String collectionName) {
|
||||
return exists(query, null, collectionName);
|
||||
}
|
||||
@@ -814,6 +838,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#exists(org.springframework.data.mongodb.core.query.Query, java.lang.Class, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Mono<Boolean> exists(Query query, @Nullable Class<?> entityClass, String collectionName) {
|
||||
|
||||
if (query == null) {
|
||||
@@ -842,6 +867,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#find(org.springframework.data.mongodb.core.query.Query, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T> Flux<T> find(Query query, Class<T> entityClass) {
|
||||
return find(query, entityClass, getCollectionName(entityClass));
|
||||
}
|
||||
@@ -850,6 +876,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#find(org.springframework.data.mongodb.core.query.Query, java.lang.Class, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public <T> Flux<T> find(@Nullable Query query, Class<T> entityClass, String collectionName) {
|
||||
|
||||
if (query == null) {
|
||||
@@ -864,6 +891,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#findById(java.lang.Object, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T> Mono<T> findById(Object id, Class<T> entityClass) {
|
||||
return findById(id, entityClass, getCollectionName(entityClass));
|
||||
}
|
||||
@@ -872,6 +900,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#findById(java.lang.Object, java.lang.Class, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public <T> Mono<T> findById(Object id, Class<T> entityClass, String collectionName) {
|
||||
|
||||
String idKey = operations.getIdPropertyName(entityClass);
|
||||
@@ -883,6 +912,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#findDistinct(org.springframework.data.mongodb.core.query.Query, java.lang.String, java.lang.Class, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T> Flux<T> findDistinct(Query query, String field, Class<?> entityClass, Class<T> resultClass) {
|
||||
return findDistinct(query, field, getCollectionName(entityClass), entityClass, resultClass);
|
||||
}
|
||||
@@ -891,6 +921,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#findDistinct(org.springframework.data.mongodb.core.query.Query, java.lang.String, java.lang.String, java.lang.Class, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> Flux<T> findDistinct(Query query, String field, String collectionName, Class<?> entityClass,
|
||||
Class<T> resultClass) {
|
||||
@@ -1073,6 +1104,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#findAndModify(org.springframework.data.mongodb.core.query.Query, org.springframework.data.mongodb.core.query.UpdateDefinition, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T> Mono<T> findAndModify(Query query, UpdateDefinition update, Class<T> entityClass) {
|
||||
return findAndModify(query, update, new FindAndModifyOptions(), entityClass, getCollectionName(entityClass));
|
||||
}
|
||||
@@ -1081,6 +1113,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#findAndModify(org.springframework.data.mongodb.core.query.Query, org.springframework.data.mongodb.core.query.UpdateDefinition, java.lang.Class, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public <T> Mono<T> findAndModify(Query query, UpdateDefinition update, Class<T> entityClass, String collectionName) {
|
||||
return findAndModify(query, update, new FindAndModifyOptions(), entityClass, collectionName);
|
||||
}
|
||||
@@ -1089,6 +1122,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#findAndModify(org.springframework.data.mongodb.core.query.Query, org.springframework.data.mongodb.core.query.UpdateDefinition, org.springframework.data.mongodb.core.FindAndModifyOptions, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T> Mono<T> findAndModify(Query query, UpdateDefinition update, FindAndModifyOptions options,
|
||||
Class<T> entityClass) {
|
||||
return findAndModify(query, update, options, entityClass, getCollectionName(entityClass));
|
||||
@@ -1098,6 +1132,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#findAndModify(org.springframework.data.mongodb.core.query.Query, org.springframework.data.mongodb.core.query.UpdateDefinition, org.springframework.data.mongodb.core.FindAndModifyOptions, java.lang.Class, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public <T> Mono<T> findAndModify(Query query, UpdateDefinition update, FindAndModifyOptions options,
|
||||
Class<T> entityClass, String collectionName) {
|
||||
|
||||
@@ -1174,6 +1209,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#findAndRemove(org.springframework.data.mongodb.core.query.Query, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T> Mono<T> findAndRemove(Query query, Class<T> entityClass) {
|
||||
return findAndRemove(query, entityClass, getCollectionName(entityClass));
|
||||
}
|
||||
@@ -1182,6 +1218,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#findAndRemove(org.springframework.data.mongodb.core.query.Query, java.lang.Class, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public <T> Mono<T> findAndRemove(Query query, Class<T> entityClass, String collectionName) {
|
||||
|
||||
operations.forType(entityClass).getCollation(query);
|
||||
@@ -1194,6 +1231,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#count(org.springframework.data.mongodb.core.query.Query, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public Mono<Long> count(Query query, Class<?> entityClass) {
|
||||
|
||||
Assert.notNull(entityClass, "Entity class must not be null!");
|
||||
@@ -1205,6 +1243,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#count(org.springframework.data.mongodb.core.query.Query, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Mono<Long> count(Query query, String collectionName) {
|
||||
return count(query, null, collectionName);
|
||||
}
|
||||
@@ -1213,6 +1252,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#count(org.springframework.data.mongodb.core.query.Query, java.lang.Class, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Mono<Long> count(Query query, @Nullable Class<?> entityClass, String collectionName) {
|
||||
|
||||
Assert.notNull(query, "Query must not be null!");
|
||||
@@ -1298,6 +1338,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#insert(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public <T> Mono<T> insert(T objectToSave) {
|
||||
|
||||
Assert.notNull(objectToSave, "Object to insert must not be null!");
|
||||
@@ -1310,6 +1351,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#insert(java.lang.Object, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public <T> Mono<T> insert(T objectToSave, String collectionName) {
|
||||
|
||||
Assert.notNull(objectToSave, "Object to insert must not be null!");
|
||||
@@ -1352,6 +1394,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#insert(java.util.Collection, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T> Flux<T> insert(Collection<? extends T> batchToSave, Class<?> entityClass) {
|
||||
return doInsertBatch(getCollectionName(entityClass), batchToSave, this.mongoConverter);
|
||||
}
|
||||
@@ -1360,6 +1403,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#insert(java.util.Collection, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public <T> Flux<T> insert(Collection<? extends T> batchToSave, String collectionName) {
|
||||
return doInsertBatch(collectionName, batchToSave, this.mongoConverter);
|
||||
}
|
||||
@@ -1368,6 +1412,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#insertAll(java.util.Collection)
|
||||
*/
|
||||
@Override
|
||||
public <T> Flux<T> insertAll(Collection<? extends T> objectsToSave) {
|
||||
return doInsertAll(objectsToSave, this.mongoConverter);
|
||||
}
|
||||
@@ -1468,6 +1513,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#save(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public <T> Mono<T> save(T objectToSave) {
|
||||
|
||||
Assert.notNull(objectToSave, "Object to save must not be null!");
|
||||
@@ -1478,6 +1524,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#save(java.lang.Object, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public <T> Mono<T> save(T objectToSave, String collectionName) {
|
||||
|
||||
Assert.notNull(objectToSave, "Object to save must not be null!");
|
||||
@@ -1672,6 +1719,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#upsert(org.springframework.data.mongodb.core.query.Query, org.springframework.data.mongodb.core.query.UpdateDefinition, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public Mono<UpdateResult> upsert(Query query, UpdateDefinition update, Class<?> entityClass) {
|
||||
return doUpdate(getCollectionName(entityClass), query, update, entityClass, true, false);
|
||||
}
|
||||
@@ -1680,6 +1728,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#upsert(org.springframework.data.mongodb.core.query.Query, org.springframework.data.mongodb.core.query.UpdateDefinition, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Mono<UpdateResult> upsert(Query query, UpdateDefinition update, String collectionName) {
|
||||
return doUpdate(collectionName, query, update, null, true, false);
|
||||
}
|
||||
@@ -1688,6 +1737,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#upsert(org.springframework.data.mongodb.core.query.Query, org.springframework.data.mongodb.core.query.UpdateDefinition, java.lang.Class, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Mono<UpdateResult> upsert(Query query, UpdateDefinition update, Class<?> entityClass, String collectionName) {
|
||||
return doUpdate(collectionName, query, update, entityClass, true, false);
|
||||
}
|
||||
@@ -1696,6 +1746,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc))
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#updateFirst(org.springframework.data.mongodb.core.query.Query, org.springframework.data.mongodb.core.query.UpdateDefinition, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public Mono<UpdateResult> updateFirst(Query query, UpdateDefinition update, Class<?> entityClass) {
|
||||
return doUpdate(getCollectionName(entityClass), query, update, entityClass, false, false);
|
||||
}
|
||||
@@ -1704,6 +1755,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#updateFirst(org.springframework.data.mongodb.core.query.Query, org.springframework.data.mongodb.core.query.UpdateDefinition, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Mono<UpdateResult> updateFirst(Query query, UpdateDefinition update, String collectionName) {
|
||||
return doUpdate(collectionName, query, update, null, false, false);
|
||||
}
|
||||
@@ -1712,6 +1764,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#updateFirst(org.springframework.data.mongodb.core.query.Query, org.springframework.data.mongodb.core.query.UpdateDefinition, java.lang.Class, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Mono<UpdateResult> updateFirst(Query query, UpdateDefinition update, Class<?> entityClass,
|
||||
String collectionName) {
|
||||
return doUpdate(collectionName, query, update, entityClass, false, false);
|
||||
@@ -1721,6 +1774,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#updateMulti(org.springframework.data.mongodb.core.query.Query, org.springframework.data.mongodb.core.query.UpdateDefinition, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public Mono<UpdateResult> updateMulti(Query query, UpdateDefinition update, Class<?> entityClass) {
|
||||
return doUpdate(getCollectionName(entityClass), query, update, entityClass, false, true);
|
||||
}
|
||||
@@ -1729,6 +1783,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#updateMulti(org.springframework.data.mongodb.core.query.Query, org.springframework.data.mongodb.core.query.UpdateDefinition, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Mono<UpdateResult> updateMulti(Query query, UpdateDefinition update, String collectionName) {
|
||||
return doUpdate(collectionName, query, update, null, false, true);
|
||||
}
|
||||
@@ -1737,6 +1792,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#updateMulti(org.springframework.data.mongodb.core.query.Query, org.springframework.data.mongodb.core.query.UpdateDefinition, java.lang.Class, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Mono<UpdateResult> updateMulti(Query query, UpdateDefinition update, Class<?> entityClass,
|
||||
String collectionName) {
|
||||
return doUpdate(collectionName, query, update, entityClass, false, true);
|
||||
@@ -1870,6 +1926,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#remove(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Mono<DeleteResult> remove(Object object) {
|
||||
|
||||
Assert.notNull(object, "Object must not be null!");
|
||||
@@ -1881,6 +1938,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#remove(java.lang.Object, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Mono<DeleteResult> remove(Object object, String collectionName) {
|
||||
|
||||
Assert.notNull(object, "Object must not be null!");
|
||||
@@ -1914,6 +1972,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#remove(org.springframework.data.mongodb.core.query.Query, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Mono<DeleteResult> remove(Query query, String collectionName) {
|
||||
return remove(query, null, collectionName);
|
||||
}
|
||||
@@ -1922,6 +1981,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#remove(org.springframework.data.mongodb.core.query.Query, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public Mono<DeleteResult> remove(Query query, Class<?> entityClass) {
|
||||
return remove(query, entityClass, getCollectionName(entityClass));
|
||||
}
|
||||
@@ -1930,6 +1990,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#remove(org.springframework.data.mongodb.core.query.Query, java.lang.Class, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Mono<DeleteResult> remove(Query query, @Nullable Class<?> entityClass, String collectionName) {
|
||||
return doRemove(collectionName, query, entityClass);
|
||||
}
|
||||
@@ -1988,6 +2049,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#findAll(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public <T> Flux<T> findAll(Class<T> entityClass) {
|
||||
return findAll(entityClass, getCollectionName(entityClass));
|
||||
}
|
||||
@@ -1996,6 +2058,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#findAll(java.lang.Class, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public <T> Flux<T> findAll(Class<T> entityClass, String collectionName) {
|
||||
return executeFindMultiInternal(new FindCallback(null), FindPublisherPreparer.NO_OP_PREPARER,
|
||||
new ReadDocumentCallback<>(mongoConverter, entityClass, collectionName), collectionName);
|
||||
@@ -2115,6 +2178,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#mapReduce(org.springframework.data.mongodb.core.query.Query, java.lang.Class, java.lang.Class, java.lang.String, java.lang.String, org.springframework.data.mongodb.core.mapreduce.MapReduceOptions)
|
||||
*/
|
||||
@Override
|
||||
public <T> Flux<T> mapReduce(Query filterQuery, Class<?> domainType, Class<T> resultType, String mapFunction,
|
||||
String reduceFunction, MapReduceOptions options) {
|
||||
|
||||
@@ -2126,6 +2190,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.mongodb.core.ReactiveMongoOperations#mapReduce(org.springframework.data.mongodb.core.query.Query, java.lang.Class, java.lang.String, java.lang.Class, java.lang.String, java.lang.String, org.springframework.data.mongodb.core.mapreduce.MapReduceOptions)
|
||||
*/
|
||||
@Override
|
||||
public <T> Flux<T> mapReduce(Query filterQuery, Class<?> domainType, String inputCollectionName, Class<T> resultType,
|
||||
String mapFunction, String reduceFunction, MapReduceOptions options) {
|
||||
|
||||
@@ -3147,6 +3212,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
*/
|
||||
interface ReactiveCollectionQueryCallback<T> extends ReactiveCollectionCallback<T> {
|
||||
|
||||
@Override
|
||||
FindPublisher<T> doInCollection(MongoCollection<Document> collection) throws MongoException, DataAccessException;
|
||||
}
|
||||
|
||||
@@ -3173,6 +3239,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
this.collectionName = collectionName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<T> doWith(Document document) {
|
||||
|
||||
maybeEmitEvent(new AfterLoadEvent<>(document, type, collectionName));
|
||||
@@ -3213,6 +3280,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
this.collectionName = collectionName;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Mono<T> doWith(Document document) {
|
||||
|
||||
@@ -3267,6 +3335,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
this.metric = metric;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<GeoResult<T>> doWith(Document object) {
|
||||
|
||||
double distance = getDistance(object);
|
||||
@@ -3298,6 +3367,7 @@ public class ReactiveMongoTemplate implements ReactiveMongoOperations, Applicati
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FindPublisher<Document> prepare(FindPublisher<Document> findPublisher) {
|
||||
|
||||
FindPublisher<Document> findPublisherToUse = operations.forType(type) //
|
||||
|
||||
@@ -482,11 +482,6 @@ abstract class GeoConverters {
|
||||
argument.add(toList(((Circle) shape).getCenter()));
|
||||
argument.add(((Circle) shape).getRadius().getNormalizedValue());
|
||||
|
||||
} else if (shape instanceof Circle) {
|
||||
|
||||
argument.add(toList(((Circle) shape).getCenter()));
|
||||
argument.add(((Circle) shape).getRadius());
|
||||
|
||||
} else if (shape instanceof Polygon) {
|
||||
|
||||
for (Point point : ((Polygon) shape).getPoints()) {
|
||||
|
||||
@@ -587,7 +587,7 @@ public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
|
||||
* @param value must not be {@literal null}.
|
||||
* @return must not be {@literal null}.
|
||||
*/
|
||||
NumericJsonSchemaObject multipleOf(Number value) {
|
||||
public NumericJsonSchemaObject multipleOf(Number value) {
|
||||
|
||||
Assert.notNull(value, "Value must not be null!");
|
||||
NumericJsonSchemaObject newInstance = newInstance(description, generateDescription, restrictions);
|
||||
@@ -665,7 +665,7 @@ public class TypedJsonSchemaObject extends UntypedJsonSchemaObject {
|
||||
* @return new instance of {@link NumericJsonSchemaObject}.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
NumericJsonSchemaObject lte(Number max) {
|
||||
public NumericJsonSchemaObject lte(Number max) {
|
||||
|
||||
Assert.notNull(max, "Max must not be null!");
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Spring Data MongoDB 3.3.2 (2021.1.2)
|
||||
Spring Data MongoDB 3.3.4 (2021.1.4)
|
||||
Copyright (c) [2010-2019] Pivotal Software, Inc.
|
||||
|
||||
This product is licensed to you under the Apache License, Version 2.0 (the "License").
|
||||
@@ -31,6 +31,8 @@ conditions of the subcomponent's license, as noted in the LICENSE file.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user