Browse Source

Prepare Spring Data MongoDB 4.x branch.

Upgrade to data-commons 3.0 and Java 17 (still source level 16 due to asm).
Remove support for threeten, joda-time.
Transition to PersistentEntitiesFactoryBean from data-commons.
Update build to MongoDB 4.4 and 5 with Java17. Remove Java8 setup.
Fix javadoc tooling error on cdi 1 vs. 2 version mix.
Disabled internal package cycle analysis as this requires transition to ArchUnit.
pull/3959/head
Christoph Strobl 4 years ago
parent
commit
dcdf3a2365
No known key found for this signature in database
GPG Key ID: 8CC1AB53391458C8
  1. 42
      Jenkinsfile
  2. 21
      ci/openjdk11-mongodb-4.4/Dockerfile
  3. 0
      ci/openjdk17-mongodb-5.0/Dockerfile
  4. 21
      ci/openjdk8-mongodb-4.0/Dockerfile
  5. 23
      ci/openjdk8-mongodb-4.4/Dockerfile
  6. 4
      ci/pipeline.properties
  7. 7
      pom.xml
  8. 2
      spring-data-mongodb-benchmarks/pom.xml
  9. 2
      spring-data-mongodb-distribution/pom.xml
  10. 18
      spring-data-mongodb/pom.xml
  11. 7
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoAuditingRegistrar.java
  12. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoCustomConversions.java
  13. 5
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/UnwrappedMongoPersistentProperty.java
  14. 9
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ConvertingParameterAccessor.java
  15. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryExecution.java
  16. 6
      spring-data-mongodb/src/main/resources/META-INF/spring.schemas
  17. 907
      spring-data-mongodb/src/main/resources/org/springframework/data/mongodb/config/spring-mongo-4.0.xsd
  18. 2
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/DependencyTests.java
  19. 9
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/config/AuditingIntegrationTests.java
  20. 31
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateTests.java
  21. 8
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/Venue.java
  22. 45
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/AggregationTests.java
  23. 38
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/convert/MappingMongoConverterUnitTests.java
  24. 4
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/geo/AbstractGeoSpatialTests.java
  25. 3
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/query/UpdateTests.java
  26. 9
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/query/StubParameterAccessor.java

42
Jenkinsfile vendored

@ -20,48 +20,10 @@ pipeline { @@ -20,48 +20,10 @@ pipeline {
stages {
stage("Docker images") {
parallel {
stage('Publish JDK (main) + MongoDB 4.0') {
when {
anyOf {
changeset "ci/openjdk8-mongodb-4.0/**"
changeset "ci/pipeline.properties"
}
}
agent { label 'data' }
options { timeout(time: 30, unit: 'MINUTES') }
steps {
script {
def image = docker.build("springci/spring-data-with-mongodb-4.0:${p['java.main.tag']}", "--build-arg BASE=${p['docker.java.main.image']} --build-arg MONGODB=${p['docker.mongodb.4.0.version']} ci/openjdk8-mongodb-4.0/")
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
image.push()
}
}
}
}
stage('Publish JDK (main) + MongoDB 4.4') {
when {
anyOf {
changeset "ci/openjdk8-mongodb-4.4/**"
changeset "ci/pipeline.properties"
}
}
agent { label 'data' }
options { timeout(time: 30, unit: 'MINUTES') }
steps {
script {
def image = docker.build("springci/spring-data-with-mongodb-4.4:${p['java.main.tag']}", "--build-arg BASE=${p['docker.java.main.image']} --build-arg MONGODB=${p['docker.mongodb.4.4.version']} ci/openjdk8-mongodb-4.4/")
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
image.push()
}
}
}
}
stage('Publish JDK (main) + MongoDB 5.0') {
when {
anyOf {
changeset "ci/openjdk8-mongodb-5.0/**"
changeset "ci/openjdk17-mongodb-5.0/**"
changeset "ci/pipeline.properties"
}
}
@ -77,7 +39,7 @@ pipeline { @@ -77,7 +39,7 @@ pipeline {
}
}
}
stage('Publish JDK (LTS) + MongoDB 4.4') {
stage('Publish JDK (main) + MongoDB 4.4') {
when {
anyOf {
changeset "ci/openjdk17-mongodb-4.4/**"

21
ci/openjdk11-mongodb-4.4/Dockerfile

@ -1,21 +0,0 @@ @@ -1,21 +0,0 @@
ARG BASE
FROM ${BASE}
# Any ARG statements before FROM are cleared.
ARG MONGODB
ENV TZ=Etc/UTC
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
sed -i -e 's/archive.ubuntu.com/mirror.one.com/g' /etc/apt/sources.list; \
sed -i -e 's/security.ubuntu.com/mirror.one.com/g' /etc/apt/sources.list; \
sed -i -e 's/http/https/g' /etc/apt/sources.list ; \
apt-get update && apt-get install -y apt-transport-https apt-utils gnupg2 ; \
apt-key adv --keyserver hkps://keyserver.ubuntu.com:443 --recv 656408E390CFB1F5 ; \
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list; \
echo ${TZ} > /etc/timezone;
RUN apt-get update ; \
apt-get install -y mongodb-org=${MONGODB} mongodb-org-server=${MONGODB} mongodb-org-shell=${MONGODB} mongodb-org-mongos=${MONGODB} mongodb-org-tools=${MONGODB} ; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*;

0
ci/openjdk8-mongodb-5.0/Dockerfile → ci/openjdk17-mongodb-5.0/Dockerfile

21
ci/openjdk8-mongodb-4.0/Dockerfile

@ -1,21 +0,0 @@ @@ -1,21 +0,0 @@
ARG BASE
FROM ${BASE}
# Any ARG statements before FROM are cleared.
ARG MONGODB
ENV TZ=Etc/UTC
ENV DEBIAN_FRONTEND=noninteractive
RUN RUN set -eux; \
sed -i -e 's/archive.ubuntu.com/mirror.one.com/g' /etc/apt/sources.list; \
sed -i -e 's/security.ubuntu.com/mirror.one.com/g' /etc/apt/sources.list; \
sed -i -e 's/http/https/g' /etc/apt/sources.list ; \
apt-get update && apt-get install -y apt-transport-https apt-utils gnupg2 ; \
apt-key adv --keyserver hkps://keyserver.ubuntu.com:443 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4 ; \
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.0.list; \
echo ${TZ} > /etc/timezone;
RUN apt-get update ; \
apt-get install -y mongodb-org=${MONGODB} mongodb-org-server=${MONGODB} mongodb-org-shell=${MONGODB} mongodb-org-mongos=${MONGODB} mongodb-org-tools=${MONGODB} ; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*;

23
ci/openjdk8-mongodb-4.4/Dockerfile

@ -1,23 +0,0 @@ @@ -1,23 +0,0 @@
ARG BASE
FROM ${BASE}
# Any ARG statements before FROM are cleared.
ARG MONGODB
ENV TZ=Etc/UTC
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
sed -i -e 's/archive.ubuntu.com/mirror.one.com/g' /etc/apt/sources.list; \
sed -i -e 's/security.ubuntu.com/mirror.one.com/g' /etc/apt/sources.list; \
sed -i -e 's/http/https/g' /etc/apt/sources.list ; \
apt-get update && apt-get install -y apt-transport-https apt-utils gnupg2 ; \
apt-key adv --keyserver hkps://keyserver.ubuntu.com:443 --recv 656408E390CFB1F5 ; \
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list; \
echo ${TZ} > /etc/timezone;
RUN apt-get update ; \
ln -T /bin/true /usr/bin/systemctl ; \
apt-get install -y mongodb-org=${MONGODB} mongodb-org-server=${MONGODB} mongodb-org-shell=${MONGODB} mongodb-org-mongos=${MONGODB} mongodb-org-tools=${MONGODB} ; \
rm /usr/bin/systemctl ; \
apt-get clean ; \
rm -rf /var/lib/apt/lists/* ;

4
ci/pipeline.properties

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
# Java versions
java.main.tag=8u312-b07-jdk
java.next.tag=11.0.13_8-jdk
java.main.tag=17.0.1_12-jdk
java.next.tag=17.0.1_12-jdk
java.lts.tag=17.0.1_12-jdk
# Docker container images - standard

7
pom.xml

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>3.4.0-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Spring Data MongoDB</name>
@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
<parent>
<groupId>org.springframework.data.build</groupId>
<artifactId>spring-data-parent</artifactId>
<version>2.7.0-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
</parent>
<modules>
@ -24,9 +24,10 @@ @@ -24,9 +24,10 @@
</modules>
<properties>
<source.level>16</source.level>
<project.type>multi</project.type>
<dist.id>spring-data-mongodb</dist.id>
<springdata.commons>2.7.0-SNAPSHOT</springdata.commons>
<springdata.commons>3.0.0-SNAPSHOT</springdata.commons>
<mongo>4.4.1</mongo>
<mongo.reactivestreams>${mongo}</mongo.reactivestreams>
<jmh.version>1.19</jmh.version>

2
spring-data-mongodb-benchmarks/pom.xml

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>3.4.0-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

2
spring-data-mongodb-distribution/pom.xml

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>3.4.0-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

18
spring-data-mongodb/pom.xml

@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb-parent</artifactId>
<version>3.4.0-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -156,7 +156,7 @@ @@ -156,7 +156,7 @@
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jcdi_2.0_spec</artifactId>
<version>1.0.1</version>
<scope>test</scope>
<scope>optional</scope>
</dependency>
<dependency>
@ -217,20 +217,6 @@ @@ -217,20 +217,6 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${jodatime}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.threeten</groupId>
<artifactId>threetenbp</artifactId>
<version>${threetenbp}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>

7
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoAuditingRegistrar.java

@ -18,6 +18,7 @@ package org.springframework.data.mongodb.config; @@ -18,6 +18,7 @@ package org.springframework.data.mongodb.config;
import java.lang.annotation.Annotation;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
@ -27,6 +28,8 @@ import org.springframework.data.auditing.IsNewAwareAuditingHandler; @@ -27,6 +28,8 @@ import org.springframework.data.auditing.IsNewAwareAuditingHandler;
import org.springframework.data.auditing.config.AuditingBeanDefinitionRegistrarSupport;
import org.springframework.data.auditing.config.AuditingConfiguration;
import org.springframework.data.config.ParsingUtils;
import org.springframework.data.mapping.context.MappingContext;
import org.springframework.data.mongodb.core.mapping.MongoMappingContext;
import org.springframework.data.mongodb.core.mapping.event.AuditingEntityCallback;
import org.springframework.util.Assert;
@ -81,8 +84,8 @@ class MongoAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupport { @@ -81,8 +84,8 @@ class MongoAuditingRegistrar extends AuditingBeanDefinitionRegistrarSupport {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(IsNewAwareAuditingHandler.class);
BeanDefinitionBuilder definition = BeanDefinitionBuilder.genericBeanDefinition(PersistentEntitiesFactoryBean.class);
definition.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_CONSTRUCTOR);
BeanDefinitionBuilder definition = BeanDefinitionBuilder.genericBeanDefinition(org.springframework.data.repository.config.PersistentEntitiesFactoryBean.class);
definition.addConstructorArgValue(new RuntimeBeanReference(MappingContext.class));
builder.addConstructorArgValue(definition.getBeanDefinition());
return configureDefaultAuditHandlerAttributes(configuration, builder);

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoCustomConversions.java

@ -36,7 +36,6 @@ import org.springframework.core.convert.TypeDescriptor; @@ -36,7 +36,6 @@ import org.springframework.core.convert.TypeDescriptor;
import org.springframework.core.convert.converter.Converter;
import org.springframework.core.convert.converter.ConverterFactory;
import org.springframework.core.convert.converter.GenericConverter;
import org.springframework.data.convert.JodaTimeConverters;
import org.springframework.data.convert.WritingConverter;
import org.springframework.data.mapping.model.SimpleTypeHolder;
import org.springframework.data.mongodb.core.mapping.MongoSimpleTypes;
@ -65,7 +64,6 @@ public class MongoCustomConversions extends org.springframework.data.convert.Cus @@ -65,7 +64,6 @@ public class MongoCustomConversions extends org.springframework.data.convert.Cus
converters.add(CustomToStringConverter.INSTANCE);
converters.addAll(MongoConverters.getConvertersToRegister());
converters.addAll(JodaTimeConverters.getConvertersToRegister());
converters.addAll(GeoConverters.getConvertersToRegister());
STORE_CONVERTERS = Collections.unmodifiableList(converters);

5
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/UnwrappedMongoPersistentProperty.java

@ -149,11 +149,6 @@ class UnwrappedMongoPersistentProperty implements MongoPersistentProperty { @@ -149,11 +149,6 @@ class UnwrappedMongoPersistentProperty implements MongoPersistentProperty {
return delegate.getTypeInformation();
}
@Override
public Iterable<? extends TypeInformation<?>> getPersistentEntityTypes() {
return delegate.getPersistentEntityTypes();
}
@Override
public Iterable<? extends TypeInformation<?>> getPersistentEntityTypeInformation() {
return delegate.getPersistentEntityTypeInformation();

9
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/ConvertingParameterAccessor.java

@ -94,15 +94,6 @@ public class ConvertingParameterAccessor implements MongoParameterAccessor { @@ -94,15 +94,6 @@ public class ConvertingParameterAccessor implements MongoParameterAccessor {
return delegate.getSort();
}
/*
* (non-Javadoc)
* @see org.springframework.data.repository.query.ParameterAccessor#getDynamicProjection()
*/
@Override
public Optional<Class<?>> getDynamicProjection() {
return delegate.getDynamicProjection();
}
/*
* (non-Javadoc)
* @see org.springframework.data.repository.query.ParameterAccessor#findDynamicProjection()

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryExecution.java

@ -33,7 +33,7 @@ import org.springframework.data.mongodb.core.ExecutableFindOperation.Terminating @@ -33,7 +33,7 @@ import org.springframework.data.mongodb.core.ExecutableFindOperation.Terminating
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.query.NearQuery;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.repository.support.PageableExecutionUtils;
import org.springframework.data.support.PageableExecutionUtils;
import org.springframework.data.util.TypeInformation;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;

6
spring-data-mongodb/src/main/resources/META-INF/spring.schemas

@ -12,7 +12,8 @@ http\://www.springframework.org/schema/data/mongo/spring-mongo-2.0.xsd=org/sprin @@ -12,7 +12,8 @@ http\://www.springframework.org/schema/data/mongo/spring-mongo-2.0.xsd=org/sprin
http\://www.springframework.org/schema/data/mongo/spring-mongo-2.2.xsd=org/springframework/data/mongodb/config/spring-mongo-2.0.xsd
http\://www.springframework.org/schema/data/mongo/spring-mongo-3.0.xsd=org/springframework/data/mongodb/config/spring-mongo-3.0.xsd
http\://www.springframework.org/schema/data/mongo/spring-mongo-3.3.xsd=org/springframework/data/mongodb/config/spring-mongo-3.3.xsd
http\://www.springframework.org/schema/data/mongo/spring-mongo.xsd=org/springframework/data/mongodb/config/spring-mongo-3.3.xsd
http\://www.springframework.org/schema/data/mongo/spring-mongo-4.0.xsd=org/springframework/data/mongodb/config/spring-mongo-4.0.xsd
http\://www.springframework.org/schema/data/mongo/spring-mongo.xsd=org/springframework/data/mongodb/config/spring-mongo-4.0.xsd
https\://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd=org/springframework/data/mongodb/config/spring-mongo-1.0.xsd
https\://www.springframework.org/schema/data/mongo/spring-mongo-1.1.xsd=org/springframework/data/mongodb/config/spring-mongo-1.1.xsd
https\://www.springframework.org/schema/data/mongo/spring-mongo-1.2.xsd=org/springframework/data/mongodb/config/spring-mongo-1.2.xsd
@ -27,4 +28,5 @@ https\://www.springframework.org/schema/data/mongo/spring-mongo-2.0.xsd=org/spri @@ -27,4 +28,5 @@ https\://www.springframework.org/schema/data/mongo/spring-mongo-2.0.xsd=org/spri
https\://www.springframework.org/schema/data/mongo/spring-mongo-2.2.xsd=org/springframework/data/mongodb/config/spring-mongo-2.2.xsd
https\://www.springframework.org/schema/data/mongo/spring-mongo-3.0.xsd=org/springframework/data/mongodb/config/spring-mongo-3.0.xsd
https\://www.springframework.org/schema/data/mongo/spring-mongo-3.3.xsd=org/springframework/data/mongodb/config/spring-mongo-3.3.xsd
https\://www.springframework.org/schema/data/mongo/spring-mongo.xsd=org/springframework/data/mongodb/config/spring-mongo-3.3.xsd
https\://www.springframework.org/schema/data/mongo/spring-mongo-4.0.xsd=org/springframework/data/mongodb/config/spring-mongo-4.0.xsd
https\://www.springframework.org/schema/data/mongo/spring-mongo.xsd=org/springframework/data/mongodb/config/spring-mongo-4.0.xsd

907
spring-data-mongodb/src/main/resources/org/springframework/data/mongodb/config/spring-mongo-4.0.xsd

@ -0,0 +1,907 @@ @@ -0,0 +1,907 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
~ Copyright 2019-2021 the original author or authors.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<xsd:schema xmlns="http://www.springframework.org/schema/data/mongo"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:tool="http://www.springframework.org/schema/tool"
xmlns:repository="http://www.springframework.org/schema/data/repository"
targetNamespace="http://www.springframework.org/schema/data/mongo"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:import namespace="http://www.springframework.org/schema/beans" />
<xsd:import namespace="http://www.springframework.org/schema/tool" />
<xsd:import namespace="http://www.springframework.org/schema/context" />
<xsd:import namespace="http://www.springframework.org/schema/data/repository"
schemaLocation="https://www.springframework.org/schema/data/repository/spring-repository.xsd" />
<xsd:element name="mongo-client" type="mongoClientType">
<xsd:annotation>
<xsd:documentation source="org.springframework.data.mongodb.core.MongoClientFactoryBean"><![CDATA[
Defines a com.mongodb.client.MongoClient instance used for accessing MongoDB.
]]></xsd:documentation>
<xsd:appinfo>
<tool:annotation>
<tool:exports type="com.mongodb.client.MongoClient"/>
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="db-factory">
<xsd:annotation>
<xsd:documentation><![CDATA[
Defines a MongoDbFactory for connecting to a specific database
]]></xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The name of the MongoDatabaseFactory definition (by default "mongoDbFactory").]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="mongo-client-ref" type="mongoRef" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The reference to a com.mongodb.client.MongoClient instance.
]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="dbname" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The name of the database to connect to. Default is 'db'.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="client-uri" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The MongoClientURI string.
@Deprecated since 3.0 - Use connection-string instead.
]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="connection-string" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The MongoDB Connection String. Supersedes client-uri.
See https://docs.mongodb.com/manual/reference/connection-string/ for full documentation.
@Since 3.0
]]>
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="write-concern">
<xsd:annotation>
<xsd:documentation>
The WriteConcern that will be the default value used when asking the MongoDatabaseFactory for a DB object
</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:union memberTypes="writeConcernEnumeration xsd:string"/>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:attributeGroup name="mongo-repository-attributes">
<xsd:attribute name="mongo-template-ref" type="mongoTemplateRef" default="mongoTemplate">
<xsd:annotation>
<xsd:documentation>
The reference to a MongoTemplate. Will default to 'mongoTemplate'.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="create-query-indexes" default="false">
<xsd:annotation>
<xsd:documentation>
Enables creation of indexes for queries that get derived from the method name
and thus reference domain class properties. Defaults to false.
</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:union memberTypes="booleanType xsd:string" />
</xsd:simpleType>
</xsd:attribute>
</xsd:attributeGroup>
<xsd:element name="repositories">
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="repository:repositories">
<xsd:attributeGroup ref="mongo-repository-attributes"/>
<xsd:attributeGroup ref="repository:repository-attributes"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="mapping-converter">
<xsd:annotation>
<xsd:documentation><![CDATA[Defines a MongoConverter for getting rich mapping functionality.]]></xsd:documentation>
<xsd:appinfo>
<tool:exports type="org.springframework.data.mongodb.core.convert.MappingMongoConverter" />
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="custom-converters" minOccurs="0">
<xsd:annotation>
<xsd:documentation><![CDATA[
Top-level element that contains one or more custom converters to be used for mapping
domain objects to and from Mongo's Document]]>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="converter" type="customConverterType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="base-package" type="xsd:string" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The name of the MappingMongoConverter instance (by default "mappingConverter").]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="base-package" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The base package in which to scan for entities annotated with @Document
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="db-factory-ref" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>
The reference to a MongoDatabaseFactory.
</xsd:documentation>
<xsd:appinfo>
<tool:annotation kind="ref">
<tool:assignable-to type="org.springframework.data.mongodb.MongoDatabaseFactory" />
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="type-mapper-ref" type="typeMapperRef" use="optional">
<xsd:annotation>
<xsd:documentation>
The reference to a MongoTypeMapper to be used by this MappingMongoConverter.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="mapping-context-ref" type="mappingContextRef" use="optional">
<xsd:annotation>
<xsd:documentation source="org.springframework.data.mapping.model.MappingContext">
The reference to a MappingContext. Will default to 'mappingContext'.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="disable-validation" use="optional">
<xsd:annotation>
<xsd:documentation source="org.springframework.data.mongodb.core.mapping.event.ValidatingMongoEventListener">
Disables JSR-303 validation on MongoDB documents before they are saved. By default it is set to false.
</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:union memberTypes="xsd:boolean xsd:string"/>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="abbreviate-field-names" use="optional">
<xsd:annotation>
<xsd:documentation source="org.springframework.data.mongodb.core.mapping.CamelCaseAbbreviatingFieldNamingStrategy">
Enables abbreviating the field names for domain class properties to the
first character of their camel case names, e.g. fooBar -> fb. Defaults to false.
</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:union memberTypes="xsd:boolean xsd:string"/>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="field-naming-strategy-ref" type="fieldNamingStrategyRef" use="optional">
<xsd:annotation>
<xsd:documentation source="org.springframework.data.mongodb.core.mapping.FieldNamingStrategy">
The reference to a FieldNamingStrategy.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="auto-index-creation" use="optional">
<xsd:annotation>
<xsd:documentation>
Enable/Disable index creation for annotated properties/entities.
</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:union memberTypes="xsd:boolean xsd:string"/>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="jmx">
<xsd:annotation>
<xsd:documentation><![CDATA[
Defines a JMX Model MBeans for monitoring a MongoDB server'.
]]></xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:attribute name="mongo-ref" type="mongoRef" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The name of the MongoClient object that determines what server to monitor. (by default "mongoClient").]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="auditing">
<xsd:annotation>
<xsd:appinfo>
<tool:annotation>
<tool:exports type="org.springframework.data.mongodb.core.mapping.event.AuditingEntityCallback" />
<tool:exports type="org.springframework.data.auditing.IsNewAwareAuditingHandler" />
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:attributeGroup ref="repository:auditing-attributes" />
<xsd:attribute name="mapping-context-ref" type="mappingContextRef" />
<xsd:attribute name="mongo-converter-ref" type="mongoConverterRef" />
</xsd:complexType>
</xsd:element>
<xsd:simpleType name="typeMapperRef">
<xsd:annotation>
<xsd:appinfo>
<tool:annotation kind="ref">
<tool:assignable-to type="org.springframework.data.mongodb.core.convert.MongoTypeMapper"/>
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
<xsd:union memberTypes="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="mappingContextRef">
<xsd:annotation>
<xsd:appinfo>
<tool:annotation kind="ref">
<tool:assignable-to type="org.springframework.data.mapping.model.MappingContext"/>
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
<xsd:union memberTypes="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="mongoConverterRef">
<xsd:annotation>
<xsd:appinfo>
<tool:annotation kind="ref">
<tool:assignable-to type="org.springframework.data.mongodb.core.convert.MongoConverter"/>
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
<xsd:union memberTypes="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="fieldNamingStrategyRef">
<xsd:annotation>
<xsd:appinfo>
<tool:annotation kind="ref">
<tool:assignable-to type="org.springframework.data.mongodb.core.mapping.FieldNamingStrategy"/>
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
<xsd:union memberTypes="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="mongoTemplateRef">
<xsd:annotation>
<xsd:appinfo>
<tool:annotation kind="ref">
<tool:assignable-to type="org.springframework.data.mongodb.core.MongoTemplate"/>
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
<xsd:union memberTypes="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="mongoRef">
<xsd:annotation>
<xsd:appinfo>
<tool:annotation kind="ref">
<tool:assignable-to type="org.springframework.data.mongodb.core.MongoClientFactoryBean"/>
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
<xsd:union memberTypes="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="sslSocketFactoryRef">
<xsd:annotation>
<xsd:appinfo>
<tool:annotation kind="ref">
<tool:assignable-to type="javax.net.ssl.SSLSocketFactory"/>
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
<xsd:union memberTypes="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="encryptionSettingsRef">
<xsd:annotation>
<xsd:documentation><![CDATA[
Reference to FactoryBean for com.mongodb.AutoEncryptionSettings - @since 2.2
]]></xsd:documentation>
<xsd:appinfo>
<tool:annotation kind="ref">
<tool:assignable-to type="org.springframework.data.mongodb.core.MongoEncryptionSettingsFactoryBean" />
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
<xsd:union memberTypes="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="serverApiRef">
<xsd:annotation>
<xsd:documentation><![CDATA[
Reference to FactoryBean for com.mongodb.MongoServerApiFactoryBean - @since 3.3
]]></xsd:documentation>
<xsd:appinfo>
<tool:annotation kind="ref">
<tool:assignable-to type="org.springframework.data.mongodb.core.MongoServerApiFactoryBean" />
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
<xsd:union memberTypes="xsd:string"/>
</xsd:simpleType>
<xsd:simpleType name="readConcernEnumeration">
<xsd:restriction base="xsd:token">
<xsd:enumeration value="DEFAULT" />
<xsd:enumeration value="LOCAL" />
<xsd:enumeration value="MAJORITY" />
<xsd:enumeration value="LINEARIZABLE" />
<xsd:enumeration value="AVAILABLE" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="writeConcernEnumeration">
<xsd:restriction base="xsd:token">
<xsd:enumeration value="ACKNOWLEDGED" />
<xsd:enumeration value="W1" />
<xsd:enumeration value="W2" />
<xsd:enumeration value="W3" />
<xsd:enumeration value="UNACKNOWLEDGED" />
<xsd:enumeration value="JOURNALED" />
<xsd:enumeration value="MAJORITY" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="readPreferenceEnumeration">
<xsd:restriction base="xsd:token">
<xsd:enumeration value="PRIMARY" />
<xsd:enumeration value="PRIMARY_PREFERRED" />
<xsd:enumeration value="SECONDARY" />
<xsd:enumeration value="SECONDARY_PREFERRED" />
<xsd:enumeration value="NEAREST" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="uuidRepresentationEnumeration">
<xsd:restriction base="xsd:token">
<xsd:enumeration value="UNSPECIFIED" />
<xsd:enumeration value="STANDARD" />
<xsd:enumeration value="C_SHARP_LEGACY" />
<xsd:enumeration value="JAVA_LEGACY" />
<xsd:enumeration value="PYTHON_LEGACY" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="clusterConnectionModeEnumeration">
<xsd:restriction base="xsd:token">
<xsd:enumeration value="SINGLE" />
<xsd:enumeration value="MULTIPLE" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="clusterTypeEnumeration">
<xsd:restriction base="xsd:token">
<xsd:enumeration value="STANDALONE" />
<xsd:enumeration value="REPLICA_SET" />
<xsd:enumeration value="SHARDED" />
<xsd:enumeration value="UNKNOWN" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="booleanType">
<xsd:restriction base="xsd:token">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="mongoClientType">
<xsd:annotation>
<xsd:documentation><![CDATA[
Configuration options for 'com.mongodb.client.MongoClient'
]]></xsd:documentation>
</xsd:annotation>
<xsd:sequence minOccurs="0" maxOccurs="1">
<xsd:element name="client-settings" type="clientSettingsType">
<xsd:annotation>
<xsd:documentation><![CDATA[
The Mongo driver settings
]]></xsd:documentation>
<xsd:appinfo>
<tool:annotation>
<tool:exports type="com.mongodb.MongoClientSettings"/>
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The name of the MongoClient definition (by default "mongoClient").]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="connection-string" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The mongodb connection string. E.g. 'mongodb://localhost:27017?replicaSet=rs0'
See https://docs.mongodb.com/manual/reference/connection-string/ for full documentation.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="port" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The port to connect to MongoDB server. Default is 27017
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="host" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The host to connect to a MongoDB server. Default is localhost
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="replica-set" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The replica set name when connecting to a cluster.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="credential" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
NOTE: Best way of setting up a connection is by providing the 'connection-string'.
The comma delimited list of username:password@database entries to use for authentication. Appending ?uri.authMechanism allows to specify the authentication challenge mechanism. If the credential you're trying to pass contains a comma itself, quote it with single quotes: '…'.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="clientSettingsType">
<xsd:annotation>
<xsd:documentation><![CDATA[
Configuration options for 'MongoClientSettings' - @since 3.0
]]></xsd:documentation>
</xsd:annotation>
<xsd:attribute name="application-name" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The application name to use when connecting to MongoDB. Mainly used to identify an operation in server logs, query logs and other profiling features.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="uuid-representation" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The storage format of UUID types.
]]></xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:union memberTypes="uuidRepresentationEnumeration xsd:string"/>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="read-preference" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The read preference to use for quries, map-reduce, aggregation and count operations.
]]></xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:union memberTypes="readPreferenceEnumeration xsd:string"/>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="read-concern" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Set the global read isolation level.
]]></xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:union memberTypes="readConcernEnumeration xsd:string"/>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="write-concern">
<xsd:annotation>
<xsd:documentation><![CDATA[
Set the default 'WriteConcern' that is controls the acknowledgment of write operations.
]]></xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:union memberTypes="writeConcernEnumeration xsd:string"/>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="retry-reads" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets whether reads should be retried if they fail due to a network error.
]]></xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:union memberTypes="booleanType xsd:string" />
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="retry-writes" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets whether writes should be retried if they fail due to a network error.
]]></xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:union memberTypes="booleanType xsd:string" />
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="socket-connect-timeout" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the socket connect timeout (msec).
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="socket-read-timeout" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the socket read timeoutn (msec).
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="socket-receive-buffer-size" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the receive buffer size.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="socket-send-buffer-size" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the send buffer size.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="server-heartbeat-frequency" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
This is the frequency that the driver will attempt to determine the current state of each server in the cluster.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="server-min-heartbeat-frequency" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
In the event that the driver has to frequently re-check a server's availability, it will wait at least this long since the previous check to avoid wasted effort.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="cluster-srv-host" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the host name to use in order to look up an SRV DNS record to find the MongoDB hosts.
NOTE: do not use along with cluster-hosts.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="cluster-hosts" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the hosts for the cluster. Any duplicate server addresses are removed from the list.
NOTE: do not use along with cluster-srv-host
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="cluster-connection-mode" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the cluster connection mode to either single node direct or multiple servers.
]]></xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:union memberTypes="clusterConnectionModeEnumeration xsd:string"/>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="cluster-type" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the cluster type (eg. SHARDED, REPLICA_SET,...).
]]></xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:union memberTypes="clusterTypeEnumeration xsd:string"/>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="cluster-local-threshold" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the local threshold when selecting a server based on fastes ping time.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="cluster-server-selection-timeout" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the timeout to apply when selecting a server.
Zero indicates an immediate timeout while a negative value means indefinitely wait.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="connection-pool-max-size" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the maximum number of connections allowed.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="connection-pool-min-size" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the minimum number of connections.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="connection-pool-max-wait-time" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the maximum time a thread may wait for a connection to become available.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="connection-pool-max-connection-life-time" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The maximum time a pooled connection can live for.
Zero indicates no limit.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="connection-pool-max-connection-idle-time" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the maximum idle time of a pooled connection.
Zero indicates no limit.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="connection-pool-maintenance-initial-delay" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the period of time to wait before running the first maintenance job on the connection pool.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="connection-pool-maintenance-frequency" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Sets the time period between runs of the maintenance job.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="ssl-enabled" default="false">
<xsd:annotation>
<xsd:documentation><![CDATA[
Set whether SSL should be enabled or not.
]]></xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:union memberTypes="booleanType xsd:string" />
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="ssl-invalid-host-name-allowed" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Set whether invalid host names should be allowed.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="ssl-provider" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Set the SSL Context instance provider.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="encryption-settings-ref" type="encryptionSettingsRef" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
AutoEncryptionSettings for MongoDB 4.2+
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="server-api-version" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
Set the server API version for MongoDB 5.0+. Use server-api-ref if required to set additional modes like 'strict',...
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="server-api-ref" type="serverApiRef" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
ServerAPI for MongoDB 5.0+
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:group name="beanElementGroup">
<xsd:choice>
<xsd:element ref="beans:bean"/>
<xsd:element ref="beans:ref"/>
</xsd:choice>
</xsd:group>
<xsd:complexType name="customConverterType">
<xsd:annotation>
<xsd:documentation><![CDATA[
Element defining a custom converter.
]]></xsd:documentation>
</xsd:annotation>
<xsd:group ref="beanElementGroup" minOccurs="0" maxOccurs="1"/>
<xsd:attribute name="ref" type="xsd:string">
<xsd:annotation>
<xsd:documentation>
A reference to a custom converter.
</xsd:documentation>
<xsd:appinfo>
<tool:annotation kind="ref"/>
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:simpleType name="converterRef">
<xsd:annotation>
<xsd:appinfo>
<tool:annotation kind="ref">
<tool:assignable-to type="org.springframework.data.mongodb.core.convert.MongoConverter"/>
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
<xsd:union memberTypes="xsd:string"/>
</xsd:simpleType>
<xsd:element name="template">
<xsd:annotation>
<xsd:documentation><![CDATA[
Defines a MongoTemplate.
]]></xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The name of the MongoTemplate definition (by default "mongoTemplate").]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="converter-ref" type="converterRef" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The reference to a MappingMongoConverter instance.
]]>
</xsd:documentation>
<xsd:appinfo>
<tool:annotation kind="ref">
<tool:assignable-to type="org.springframework.data.mongodb.core.convert.MongoConverter"/>
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="db-factory-ref" type="xsd:string"
use="optional">
<xsd:annotation>
<xsd:documentation>
The reference to a MongoDatabaseFactory.
</xsd:documentation>
<xsd:appinfo>
<tool:annotation kind="ref">
<tool:assignable-to
type="org.springframework.data.mongodb.MongoDatabaseFactory" />
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="write-concern">
<xsd:annotation>
<xsd:documentation>
The WriteConcern that will be the default value used when asking the MongoDatabaseFactory for a DB object
</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:union memberTypes="writeConcernEnumeration xsd:string"/>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="gridFsTemplate">
<xsd:annotation>
<xsd:documentation><![CDATA[
Defines a GridFsTemplate.
]]></xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The name of the GridFsTemplate definition (by default "gridFsTemplate").]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="converter-ref" type="converterRef" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The reference to a MappingMongoConverter instance.
]]>
</xsd:documentation>
<xsd:appinfo>
<tool:annotation kind="ref">
<tool:assignable-to type="org.springframework.data.mongodb.core.convert.MongoConverter"/>
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="db-factory-ref" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>
The reference to a MongoDatabaseFactory.
</xsd:documentation>
<xsd:appinfo>
<tool:annotation kind="ref">
<tool:assignable-to type="org.springframework.data.mongodb.MongoDatabaseFactory" />
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="bucket" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The GridFs bucket string.]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
</xsd:schema>

2
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/DependencyTests.java

@ -20,6 +20,7 @@ import static org.hamcrest.MatcherAssert.*; @@ -20,6 +20,7 @@ import static org.hamcrest.MatcherAssert.*;
import de.schauderhaft.degraph.configuration.NamedPattern;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
@ -28,6 +29,7 @@ import org.junit.jupiter.api.Test; @@ -28,6 +29,7 @@ import org.junit.jupiter.api.Test;
* @author Jens Schauder
* @author Oliver Gierke
*/
@Disabled("Needs to be tansitioned to ArchUnit")
class DependencyTests {
@Test

9
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/config/AuditingIntegrationTests.java

@ -17,7 +17,8 @@ package org.springframework.data.mongodb.config; @@ -17,7 +17,8 @@ package org.springframework.data.mongodb.config;
import static org.assertj.core.api.Assertions.*;
import org.joda.time.DateTime;
import java.util.Date;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.AbstractApplicationContext;
@ -66,11 +67,11 @@ public class AuditingIntegrationTests { @@ -66,11 +67,11 @@ public class AuditingIntegrationTests {
class Entity {
@Id Long id;
@CreatedDate DateTime created;
DateTime modified;
@CreatedDate Date created;
Date modified;
@LastModifiedDate
public DateTime getModified() {
public Date getModified() {
return modified;
}
}

31
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateTests.java

@ -33,6 +33,8 @@ import java.math.BigDecimal; @@ -33,6 +33,8 @@ import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.Duration;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
@ -40,7 +42,6 @@ import java.util.stream.Collectors; @@ -40,7 +42,6 @@ import java.util.stream.Collectors;
import java.util.stream.IntStream;
import org.bson.types.ObjectId;
import org.joda.time.DateTime;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@ -62,6 +63,7 @@ import org.springframework.data.domain.PageRequest; @@ -62,6 +63,7 @@ import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.mapping.MappingException;
import org.springframework.data.mapping.context.PersistentEntities;
import org.springframework.data.mongodb.InvalidMongoDbApiUsageException;
import org.springframework.data.mongodb.MongoDatabaseFactory;
import org.springframework.data.mongodb.core.convert.LazyLoadingProxy;
@ -148,7 +150,9 @@ public class MongoTemplateTests { @@ -148,7 +150,9 @@ public class MongoTemplateTests {
});
cfg.configureAuditing(it -> {
it.auditingHandler(IsNewAwareAuditingHandler::new);
it.auditingHandler(ctx -> {
return new IsNewAwareAuditingHandler(PersistentEntities.of(ctx));
});
});
});
@ -1341,11 +1345,11 @@ public class MongoTemplateTests { @@ -1341,11 +1345,11 @@ public class MongoTemplateTests {
@Test
public void returnsEntityWhenQueryingForDateTime() {
DateTime dateTime = new DateTime(2011, 3, 3, 12, 0, 0, 0);
LocalDateTime dateTime = LocalDateTime.of(2011, 3, 3, 12, 0, 0, 0);
TestClass testClass = new TestClass(dateTime);
mappingTemplate.save(testClass);
List<TestClass> testClassList = mappingTemplate.find(new Query(Criteria.where("myDate").is(dateTime.toDate())),
List<TestClass> testClassList = mappingTemplate.find(new Query(Criteria.where("myDate").is(dateTime)),
TestClass.class);
assertThat(testClassList.size()).isEqualTo(1);
assertThat(testClassList.get(0).myDate).isEqualTo(testClass.myDate);
@ -4007,10 +4011,10 @@ public class MongoTemplateTests { @@ -4007,10 +4011,10 @@ public class MongoTemplateTests {
static class TestClass {
DateTime myDate;
LocalDateTime myDate;
@PersistenceConstructor
TestClass(DateTime myDate) {
TestClass(LocalDateTime myDate) {
this.myDate = myDate;
}
}
@ -4021,21 +4025,24 @@ public class MongoTemplateTests { @@ -4021,21 +4025,24 @@ public class MongoTemplateTests {
String name;
}
static enum DateTimeToDateConverter implements Converter<DateTime, Date> {
static enum DateTimeToDateConverter implements Converter<LocalDateTime, Date> {
INSTANCE;
public Date convert(DateTime source) {
return source == null ? null : source.toDate();
public Date convert(LocalDateTime source) {
return source == null ? null : java.util.Date
.from(source.atZone(ZoneId.systemDefault())
.toInstant());
}
}
static enum DateToDateTimeConverter implements Converter<Date, DateTime> {
static enum DateToDateTimeConverter implements Converter<Date, LocalDateTime> {
INSTANCE;
public DateTime convert(Date source) {
return source == null ? null : new DateTime(source.getTime());
public LocalDateTime convert(Date source) {
return source == null ? null : LocalDateTime.ofInstant(
source.toInstant(), ZoneId.systemDefault());
}
}

8
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/Venue.java

@ -16,8 +16,8 @@ @@ -16,8 +16,8 @@
package org.springframework.data.mongodb.core;
import java.util.Arrays;
import java.util.Date;
import org.joda.time.LocalDate;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.PersistenceConstructor;
import org.springframework.data.mongodb.core.mapping.Document;
@ -28,7 +28,7 @@ public class Venue { @@ -28,7 +28,7 @@ public class Venue {
@Id private String id;
private String name;
private double[] location;
private LocalDate openingDate;
private Date openingDate;
@PersistenceConstructor
Venue(String name, double[] location) {
@ -51,11 +51,11 @@ public class Venue { @@ -51,11 +51,11 @@ public class Venue {
return location;
}
public LocalDate getOpeningDate() {
public Date getOpeningDate() {
return openingDate;
}
public void setOpeningDate(LocalDate openingDate) {
public void setOpeningDate(Date openingDate) {
this.openingDate = openingDate;
}

45
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/AggregationTests.java

@ -26,6 +26,14 @@ import lombok.Builder; @@ -26,6 +26,14 @@ import lombok.Builder;
import java.io.BufferedInputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.temporal.ChronoField;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@ -37,9 +45,6 @@ import org.apache.commons.logging.Log; @@ -37,9 +45,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.assertj.core.data.Offset;
import org.bson.Document;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.LocalDateTime;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@ -58,6 +63,7 @@ import org.springframework.data.mongodb.core.TestEntities; @@ -58,6 +63,7 @@ import org.springframework.data.mongodb.core.TestEntities;
import org.springframework.data.mongodb.core.Venue;
import org.springframework.data.mongodb.core.aggregation.AggregationTests.CarDescriptor.Entry;
import org.springframework.data.mongodb.core.aggregation.BucketAutoOperation.Granularities;
import org.springframework.data.mongodb.core.aggregation.DateOperators.TemporalUnits;
import org.springframework.data.mongodb.core.aggregation.VariableOperators.Let.ExpressionVariable;
import org.springframework.data.mongodb.core.geo.GeoJsonPoint;
import org.springframework.data.mongodb.core.index.GeoSpatialIndexType;
@ -1146,11 +1152,11 @@ public class AggregationTests { @@ -1146,11 +1152,11 @@ public class AggregationTests {
mongoTemplate.dropCollection(User.class);
LocalDateTime now = new LocalDateTime();
Instant now = Instant.now();
User user1 = new User("u1", new PushMessage("1", "aaa", now.toDate()));
User user2 = new User("u2", new PushMessage("2", "bbb", now.minusDays(2).toDate()));
User user3 = new User("u3", new PushMessage("3", "ccc", now.minusDays(1).toDate()));
User user1 = new User("u1", new PushMessage("1", "aaa", now));
User user2 = new User("u2", new PushMessage("2", "bbb", now.minus(2, ChronoUnit.DAYS)));
User user3 = new User("u3", new PushMessage("3", "ccc", now.minus(1, ChronoUnit.DAYS)));
mongoTemplate.save(user1);
mongoTemplate.save(user2);
@ -1159,7 +1165,7 @@ public class AggregationTests { @@ -1159,7 +1165,7 @@ public class AggregationTests {
Aggregation agg = newAggregation( //
project("id", "msgs"), //
unwind("msgs"), //
match(where("msgs.createDate").gt(now.minusDays(1).toDate())), //
match(where("msgs.createDate").gt(Date.from(now.minus(1, ChronoUnit.DAYS)))), //
group("id").push("msgs").as("msgs") //
);
@ -1375,14 +1381,9 @@ public class AggregationTests { @@ -1375,14 +1381,9 @@ public class AggregationTests {
mongoTemplate.dropCollection(ObjectWithDate.class);
DateTime dateTime = new DateTime() //
.withZone(DateTimeZone.UTC) //
.withYear(2014) //
.withMonthOfYear(2) //
.withDayOfMonth(7) //
.withTime(3, 4, 5, 6).toDateTimeISO();
ZonedDateTime dateTime = ZonedDateTime.of(LocalDateTime.of(LocalDate.of(2014, 2, 7), LocalTime.of(3, 4, 5, 6)), ZoneId.of("UTC"));
ObjectWithDate owd = new ObjectWithDate(dateTime.toDate());
ObjectWithDate owd = new ObjectWithDate(Date.from(dateTime.toInstant()));
mongoTemplate.insert(owd);
ProjectionOperation dateProjection = Aggregation.project() //
@ -1406,12 +1407,12 @@ public class AggregationTests { @@ -1406,12 +1407,12 @@ public class AggregationTests {
assertThat(result.getMappedResults()).hasSize(1);
Document document = result.getMappedResults().get(0);
assertThat(document.get("hour")).isEqualTo((Object) dateTime.getHourOfDay());
assertThat(document.get("min")).isEqualTo((Object) dateTime.getMinuteOfHour());
assertThat(document.get("second")).isEqualTo((Object) dateTime.getSecondOfMinute());
assertThat(document.get("millis")).isEqualTo((Object) dateTime.getMillisOfSecond());
assertThat(document.get("hour")).isEqualTo((Object) dateTime.getHour());
assertThat(document.get("min")).isEqualTo((Object) dateTime.getMinute());
assertThat(document.get("second")).isEqualTo((Object) dateTime.getSecond());
assertThat(document.get("millis")).isEqualTo((Object) dateTime.get(ChronoField.MILLI_OF_SECOND));
assertThat(document.get("year")).isEqualTo((Object) dateTime.getYear());
assertThat(document.get("month")).isEqualTo((Object) dateTime.getMonthOfYear());
assertThat(document.get("month")).isEqualTo((Object) dateTime.getMonthValue());
// dateTime.getWeekOfWeekyear()) returns 6 since for MongoDB the week starts on sunday and not on monday.
assertThat(document.get("week")).isEqualTo((Object) 5);
assertThat(document.get("dayOfYear")).isEqualTo((Object) dateTime.getDayOfYear());
@ -2083,6 +2084,10 @@ public class AggregationTests { @@ -2083,6 +2084,10 @@ public class AggregationTests {
public PushMessage() {}
PushMessage(String id, String content, Instant createDate) {
this(id, content, Date.from(createDate));
}
PushMessage(String id, String content, Date createDate) {
this.id = id;
this.content = content;

38
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/convert/MappingMongoConverterUnitTests.java

@ -31,11 +31,11 @@ import java.time.LocalDateTime; @@ -31,11 +31,11 @@ import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.*;
import org.assertj.core.api.DateAssert;
import org.bson.types.Binary;
import org.bson.types.Code;
import org.bson.types.Decimal128;
import org.bson.types.ObjectId;
import org.joda.time.LocalDate;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@ -144,34 +144,6 @@ class MappingMongoConverterUnitTests { @@ -144,34 +144,6 @@ class MappingMongoConverterUnitTests {
assertThat(document.get("s").toString()).isEqualTo("Broadway");
}
@Test
void convertsJodaTimeTypesCorrectly() {
converter = new MappingMongoConverter(resolver, mappingContext);
converter.afterPropertiesSet();
Person person = new Person();
person.birthDate = new LocalDate();
org.bson.Document document = new org.bson.Document();
converter.write(person, document);
assertThat(document.get("birthDate")).isInstanceOf(Date.class);
Person result = converter.read(Person.class, document);
assertThat(result.birthDate).isNotNull();
}
@Test
void convertsCustomTypeOnConvertToMongoType() {
converter = new MappingMongoConverter(resolver, mappingContext);
converter.afterPropertiesSet();
LocalDate date = new LocalDate();
converter.convertToMongoType(date);
}
@Test // DATAMONGO-130
void writesMapTypeCorrectly() {
@ -197,7 +169,7 @@ class MappingMongoConverterUnitTests { @@ -197,7 +169,7 @@ class MappingMongoConverterUnitTests {
void usesDocumentsStoredTypeIfSubtypeOfRequest() {
org.bson.Document document = new org.bson.Document();
document.put("birthDate", new LocalDate());
document.put("birthDate", new Date());
document.put(DefaultMongoTypeMapper.DEFAULT_TYPE_KEY, Person.class.getName());
assertThat(converter.read(Contact.class, document)).isInstanceOf(Person.class);
@ -207,7 +179,7 @@ class MappingMongoConverterUnitTests { @@ -207,7 +179,7 @@ class MappingMongoConverterUnitTests {
void ignoresDocumentsStoredTypeIfCompletelyDifferentTypeRequested() {
org.bson.Document document = new org.bson.Document();
document.put("birthDate", new LocalDate());
document.put("birthDate", new Date());
document.put(DefaultMongoTypeMapper.DEFAULT_TYPE_KEY, Person.class.getName());
assertThat(converter.read(BirthDateContainer.class, document)).isInstanceOf(BirthDateContainer.class);
@ -2759,7 +2731,7 @@ class MappingMongoConverterUnitTests { @@ -2759,7 +2731,7 @@ class MappingMongoConverterUnitTests {
@Id String id;
LocalDate birthDate;
Date birthDate;
@Field("foo") String firstname;
String lastname;
@ -2842,7 +2814,7 @@ class MappingMongoConverterUnitTests { @@ -2842,7 +2814,7 @@ class MappingMongoConverterUnitTests {
}
static class BirthDateContainer {
LocalDate birthDate;
Date birthDate;
}
static class BigDecimalContainer {

4
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/geo/AbstractGeoSpatialTests.java

@ -20,10 +20,10 @@ import static org.springframework.data.mongodb.core.query.Criteria.*; @@ -20,10 +20,10 @@ import static org.springframework.data.mongodb.core.query.Criteria.*;
import static org.springframework.data.mongodb.core.query.Query.*;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Set;
import org.joda.time.LocalDate;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@ -191,7 +191,7 @@ public abstract class AbstractGeoSpatialTests { @@ -191,7 +191,7 @@ public abstract class AbstractGeoSpatialTests {
@Test // DATAMONGO-1360
public void mapsQueryContainedInNearQuery() {
Query query = query(where("openingDate").lt(LocalDate.now()));
Query query = query(where("openingDate").lt(new Date()));
template.geoNear(NearQuery.near(1.5, 1.7).spherical(true).query(query), Venue.class);
}
}

3
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/query/UpdateTests.java

@ -22,7 +22,6 @@ import java.util.Date; @@ -22,7 +22,6 @@ import java.util.Date;
import java.util.Map;
import org.bson.Document;
import org.joda.time.DateTime;
import org.junit.jupiter.api.Test;
import org.springframework.data.mongodb.core.DocumentTestUtils;
import org.springframework.data.mongodb.core.query.Update.Position;
@ -348,7 +347,7 @@ public class UpdateTests { @@ -348,7 +347,7 @@ public class UpdateTests {
@Test // DATAMONGO-1002
public void toStringWorksForUpdateWithComplexObject() {
Update update = new Update().addToSet("key", new DateTime());
Update update = new Update().addToSet("key", new Date());
assertThat(update.toString()).isNotNull();
}

9
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/query/StubParameterAccessor.java

@ -155,15 +155,6 @@ class StubParameterAccessor implements MongoParameterAccessor { @@ -155,15 +155,6 @@ class StubParameterAccessor implements MongoParameterAccessor {
return this.values;
}
/*
* (non-Javadoc)
* @see org.springframework.data.repository.query.ParameterAccessor#getDynamicProjection()
*/
@Override
public Optional<Class<?>> getDynamicProjection() {
return Optional.empty();
}
/*
* (non-Javadoc)
* @see org.springframework.data.repository.query.ParameterAccessor#findDynamicProjection()

Loading…
Cancel
Save