Compare commits
76 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83307c424f | ||
|
|
8394523645 | ||
|
|
62be436569 | ||
|
|
44e6f5fa3f | ||
|
|
f2fb05662f | ||
|
|
a1fbe31551 | ||
|
|
fca1a79f81 | ||
|
|
cbf87e6e49 | ||
|
|
af133c26d0 | ||
|
|
ab5b1f0140 | ||
|
|
3a5876537b | ||
|
|
48f51d0fb0 | ||
|
|
fb499f8c69 | ||
|
|
bcc2c94e03 | ||
|
|
284f547e99 | ||
|
|
d824f3b8b2 | ||
|
|
7b1a96f4a9 | ||
|
|
4f75fec5c5 | ||
|
|
61bd56dd74 | ||
|
|
b4222c5646 | ||
|
|
4a45928aee | ||
|
|
e2200eccf7 | ||
|
|
96c4901e7f | ||
|
|
1393f23f3b | ||
|
|
9bbe1f2a26 | ||
|
|
eacfe2b8f7 | ||
|
|
674f0cca2b | ||
|
|
da7b51a51e | ||
|
|
a1b5175299 | ||
|
|
56fff286aa | ||
|
|
60112b4d14 | ||
|
|
277b7a1c7c | ||
|
|
c5b892f03b | ||
|
|
dbf43941be | ||
|
|
1d98b77f3d | ||
|
|
cd4e4065ff | ||
|
|
9f4872de4f | ||
|
|
7abf69e575 | ||
|
|
588ed2b0e2 | ||
|
|
8a228f22cd | ||
|
|
d652b2bdb4 | ||
|
|
f7e527e45c | ||
|
|
aede7c9cad | ||
|
|
1a5de2e1db | ||
|
|
cc07a1bbb4 | ||
|
|
32cbae0e5f | ||
|
|
9eaf67148d | ||
|
|
ff60149166 | ||
|
|
f7a010827d | ||
|
|
1e8c4cec5b | ||
|
|
0e0b45597b | ||
|
|
b014fe4c7c | ||
|
|
ead7679f21 | ||
|
|
18cf94dc34 | ||
|
|
30d99445e2 | ||
|
|
839aecee84 | ||
|
|
c6592b01b0 | ||
|
|
48176a833c | ||
|
|
0facdcfa98 | ||
|
|
837a9885f2 | ||
|
|
6cc5bc627a | ||
|
|
84f7f433f7 | ||
|
|
7df9e932f7 | ||
|
|
5308e6c37f | ||
|
|
bc1c6c9a64 | ||
|
|
62006129ca | ||
|
|
5c2370399f | ||
|
|
3bffe402c0 | ||
|
|
6959c56df6 | ||
|
|
b5bc4320aa | ||
|
|
909c51d00a | ||
|
|
4a04e82e86 | ||
|
|
1370653c93 | ||
|
|
ebfcfb3834 | ||
|
|
77aafc597b | ||
|
|
a4503812bd |
38
.travis.yml
Normal file
38
.travis.yml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
language: java
|
||||||
|
|
||||||
|
jdk:
|
||||||
|
- oraclejdk8
|
||||||
|
|
||||||
|
before_install:
|
||||||
|
- mkdir -p downloads
|
||||||
|
- mkdir -p var/db var/log
|
||||||
|
- if [[ ! -d downloads/mongodb-linux-x86_64-ubuntu1604-${MONGO_VERSION} ]] ; then cd downloads && wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-${MONGO_VERSION}.tgz && tar xzf mongodb-linux-x86_64-ubuntu1604-${MONGO_VERSION}.tgz && cd ..; fi
|
||||||
|
- downloads/mongodb-linux-x86_64-ubuntu1604-${MONGO_VERSION}/bin/mongod --version
|
||||||
|
- downloads/mongodb-linux-x86_64-ubuntu1604-${MONGO_VERSION}/bin/mongod --dbpath var/db --replSet rs0 --fork --logpath var/log/mongod.log
|
||||||
|
- sleep 10
|
||||||
|
- |-
|
||||||
|
downloads/mongodb-linux-x86_64-ubuntu1604-${MONGO_VERSION}/bin/mongo --eval "rs.initiate({_id: 'rs0', members:[{_id: 0, host: '127.0.0.1:27017'}]});"
|
||||||
|
sleep 15
|
||||||
|
|
||||||
|
env:
|
||||||
|
matrix:
|
||||||
|
- MONGO_VERSION=4.1.10
|
||||||
|
- MONGO_VERSION=4.0.4
|
||||||
|
- MONGO_VERSION=3.6.12
|
||||||
|
- MONGO_VERSION=3.4.20
|
||||||
|
global:
|
||||||
|
- PROFILE=ci
|
||||||
|
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- oracle-java8-installer
|
||||||
|
|
||||||
|
sudo: false
|
||||||
|
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- $HOME/.m2
|
||||||
|
- downloads
|
||||||
|
|
||||||
|
script: "mvn clean dependency:list test -P${PROFILE} -Dsort"
|
||||||
29
Jenkinsfile
vendored
29
Jenkinsfile
vendored
@@ -3,7 +3,7 @@ pipeline {
|
|||||||
|
|
||||||
triggers {
|
triggers {
|
||||||
pollSCM 'H/10 * * * *'
|
pollSCM 'H/10 * * * *'
|
||||||
upstream(upstreamProjects: "spring-data-commons/2.2.x", threshold: hudson.model.Result.SUCCESS)
|
upstream(upstreamProjects: "spring-data-commons/master", threshold: hudson.model.Result.SUCCESS)
|
||||||
}
|
}
|
||||||
|
|
||||||
options {
|
options {
|
||||||
@@ -68,7 +68,7 @@ pipeline {
|
|||||||
stage("test: baseline") {
|
stage("test: baseline") {
|
||||||
when {
|
when {
|
||||||
anyOf {
|
anyOf {
|
||||||
branch '2.2.x'
|
branch 'master'
|
||||||
not { triggeredBy 'UpstreamCause' }
|
not { triggeredBy 'UpstreamCause' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -80,9 +80,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
options { timeout(time: 30, unit: 'MINUTES') }
|
options { timeout(time: 30, unit: 'MINUTES') }
|
||||||
environment {
|
|
||||||
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
|
|
||||||
}
|
|
||||||
steps {
|
steps {
|
||||||
sh 'rm -rf ?'
|
sh 'rm -rf ?'
|
||||||
sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
|
sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
|
||||||
@@ -90,14 +87,14 @@ pipeline {
|
|||||||
sh 'sleep 10'
|
sh 'sleep 10'
|
||||||
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
|
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
|
||||||
sh 'sleep 15'
|
sh 'sleep 15'
|
||||||
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean dependency:list test -Dsort -U -B'
|
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list test -Dsort -U -B'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage("Test other configurations") {
|
stage("Test other configurations") {
|
||||||
when {
|
when {
|
||||||
anyOf {
|
anyOf {
|
||||||
branch '2.2.x'
|
branch 'master'
|
||||||
not { triggeredBy 'UpstreamCause' }
|
not { triggeredBy 'UpstreamCause' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -111,9 +108,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
options { timeout(time: 30, unit: 'MINUTES') }
|
options { timeout(time: 30, unit: 'MINUTES') }
|
||||||
environment {
|
|
||||||
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
|
|
||||||
}
|
|
||||||
steps {
|
steps {
|
||||||
sh 'rm -rf ?'
|
sh 'rm -rf ?'
|
||||||
sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
|
sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
|
||||||
@@ -121,7 +115,7 @@ pipeline {
|
|||||||
sh 'sleep 10'
|
sh 'sleep 10'
|
||||||
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
|
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
|
||||||
sh 'sleep 15'
|
sh 'sleep 15'
|
||||||
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean dependency:list test -Dsort -U -B'
|
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list test -Dsort -U -B'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("test: mongodb 4.1") {
|
stage("test: mongodb 4.1") {
|
||||||
@@ -133,9 +127,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
options { timeout(time: 30, unit: 'MINUTES') }
|
options { timeout(time: 30, unit: 'MINUTES') }
|
||||||
environment {
|
|
||||||
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
|
|
||||||
}
|
|
||||||
steps {
|
steps {
|
||||||
sh 'rm -rf ?'
|
sh 'rm -rf ?'
|
||||||
sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
|
sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
|
||||||
@@ -143,7 +134,7 @@ pipeline {
|
|||||||
sh 'sleep 10'
|
sh 'sleep 10'
|
||||||
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
|
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
|
||||||
sh 'sleep 15'
|
sh 'sleep 15'
|
||||||
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean dependency:list test -Dsort -U -B'
|
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list test -Dsort -U -B'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -152,7 +143,7 @@ pipeline {
|
|||||||
stage('Release to artifactory') {
|
stage('Release to artifactory') {
|
||||||
when {
|
when {
|
||||||
anyOf {
|
anyOf {
|
||||||
branch '2.2.x'
|
branch 'master'
|
||||||
not { triggeredBy 'UpstreamCause' }
|
not { triggeredBy 'UpstreamCause' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -171,7 +162,7 @@ pipeline {
|
|||||||
|
|
||||||
steps {
|
steps {
|
||||||
sh 'rm -rf ?'
|
sh 'rm -rf ?'
|
||||||
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,artifactory ' +
|
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' +
|
||||||
'-Dartifactory.server=https://repo.spring.io ' +
|
'-Dartifactory.server=https://repo.spring.io ' +
|
||||||
"-Dartifactory.username=${ARTIFACTORY_USR} " +
|
"-Dartifactory.username=${ARTIFACTORY_USR} " +
|
||||||
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
|
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
|
||||||
@@ -184,7 +175,7 @@ pipeline {
|
|||||||
|
|
||||||
stage('Publish documentation') {
|
stage('Publish documentation') {
|
||||||
when {
|
when {
|
||||||
branch '2.2.x'
|
branch 'master'
|
||||||
}
|
}
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
@@ -200,7 +191,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
steps {
|
steps {
|
||||||
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,distribute ' +
|
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' +
|
||||||
'-Dartifactory.server=https://repo.spring.io ' +
|
'-Dartifactory.server=https://repo.spring.io ' +
|
||||||
"-Dartifactory.username=${ARTIFACTORY_USR} " +
|
"-Dartifactory.username=${ARTIFACTORY_USR} " +
|
||||||
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
|
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
|
||||||
|
|||||||
202
LICENSE.txt
202
LICENSE.txt
@@ -1,202 +0,0 @@
|
|||||||
|
|
||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
https://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright {yyyy} {name of copyright owner}
|
|
||||||
|
|
||||||
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.
|
|
||||||
15
README.adoc
15
README.adoc
@@ -105,17 +105,18 @@ If you are just starting out with Spring, try one of the https://spring.io/guide
|
|||||||
* If you are upgrading, check out the https://docs.spring.io/spring-data/mongodb/docs/current/changelog.txt[changelog] for "`new and noteworthy`" features.
|
* If you are upgrading, check out the https://docs.spring.io/spring-data/mongodb/docs/current/changelog.txt[changelog] for "`new and noteworthy`" features.
|
||||||
* Ask a question - we monitor https://stackoverflow.com[stackoverflow.com] for questions tagged with https://stackoverflow.com/tags/spring-data[`spring-data-mongodb`].
|
* Ask a question - we monitor https://stackoverflow.com[stackoverflow.com] for questions tagged with https://stackoverflow.com/tags/spring-data[`spring-data-mongodb`].
|
||||||
You can also chat with the community on https://gitter.im/spring-projects/spring-data[Gitter].
|
You can also chat with the community on https://gitter.im/spring-projects/spring-data[Gitter].
|
||||||
* Report bugs with Spring Data MongoDB at https://github.com/spring-projects/spring-data-mongodb/issues[github.com/spring-projects/spring-data-mongodb/issues].
|
* Report bugs with Spring Data MongoDB at https://jira.spring.io/browse/DATAMONGO[jira.spring.io/browse/DATAMONGO].
|
||||||
|
|
||||||
== Reporting Issues
|
== Reporting Issues
|
||||||
|
|
||||||
Spring Data uses Github as issue tracking system to record bugs and feature requests.
|
Spring Data uses JIRA as issue tracking system to record bugs and feature requests. If you want to raise an issue, please follow the recommendations below:
|
||||||
If you want to raise an issue, please follow the recommendations below:
|
|
||||||
|
|
||||||
* Before you log a bug, please search the https://github.com/spring-projects/spring-data-mongodb/issues[issue tracker] to see if someone has already reported the problem.
|
* Before you log a bug, please search the
|
||||||
* If the issue does not already exist, https://github.com/spring-projects/spring-data-mongodb/issues/new[create a new issue].
|
https://jira.spring.io/browse/DATAMONGO[issue tracker] to see if someone has already reported the problem.
|
||||||
* Please provide as much information as possible with the issue report, we like to know the version of Spring Data that you are using, the JVM version, Stacktrace, etc.
|
* If the issue doesn’t already exist, https://jira.spring.io/browse/DATAMONGO[create a new issue].
|
||||||
* If you need to paste code, or include a stack trace use https://guides.github.com/features/mastering-markdown/[Markdown] code fences +++```+++.
|
* Please provide as much information as possible with the issue report, we like to know the version of Spring Data that you are using and JVM version.
|
||||||
|
* If you need to paste code, or include a stack trace use JIRA `{code}…{code}` escapes before and after your text.
|
||||||
|
* If possible try to create a test-case or project that replicates the issue. Attach a link to your code or a compressed file containing your code.
|
||||||
|
|
||||||
== Building from Source
|
== Building from Source
|
||||||
|
|
||||||
|
|||||||
15
pom.xml
15
pom.xml
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>org.springframework.data</groupId>
|
<groupId>org.springframework.data</groupId>
|
||||||
<artifactId>spring-data-mongodb-parent</artifactId>
|
<artifactId>spring-data-mongodb-parent</artifactId>
|
||||||
<version>2.2.14.BUILD-SNAPSHOT</version>
|
<version>3.0.0.M2</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<name>Spring Data MongoDB</name>
|
<name>Spring Data MongoDB</name>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.data.build</groupId>
|
<groupId>org.springframework.data.build</groupId>
|
||||||
<artifactId>spring-data-parent</artifactId>
|
<artifactId>spring-data-parent</artifactId>
|
||||||
<version>2.2.14.BUILD-SNAPSHOT</version>
|
<version>2.3.0.M2</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
@@ -26,9 +26,9 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<project.type>multi</project.type>
|
<project.type>multi</project.type>
|
||||||
<dist.id>spring-data-mongodb</dist.id>
|
<dist.id>spring-data-mongodb</dist.id>
|
||||||
<springdata.commons>2.2.14.BUILD-SNAPSHOT</springdata.commons>
|
<springdata.commons>2.3.0.M2</springdata.commons>
|
||||||
<mongo>3.11.2</mongo>
|
<mongo>3.12.0</mongo>
|
||||||
<mongo.reactivestreams>1.12.0</mongo.reactivestreams>
|
<mongo.reactivestreams>1.13.0</mongo.reactivestreams>
|
||||||
<jmh.version>1.19</jmh.version>
|
<jmh.version>1.19</jmh.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
@@ -134,8 +134,8 @@
|
|||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>spring-libs-snapshot</id>
|
<id>spring-libs-milestone</id>
|
||||||
<url>https://repo.spring.io/libs-snapshot</url>
|
<url>https://repo.spring.io/libs-milestone</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
@@ -148,6 +148,7 @@
|
|||||||
<id>spring-libs-milestone</id>
|
<id>spring-libs-milestone</id>
|
||||||
<url>https://repo.spring.io/libs-milestone</url>
|
<url>https://repo.spring.io/libs-milestone</url>
|
||||||
</pluginRepository>
|
</pluginRepository>
|
||||||
|
|
||||||
</pluginRepositories>
|
</pluginRepositories>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
29
settings.xml
29
settings.xml
@@ -1,29 +0,0 @@
|
|||||||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
|
|
||||||
https://maven.apache.org/xsd/settings-1.0.0.xsd">
|
|
||||||
|
|
||||||
<servers>
|
|
||||||
<server>
|
|
||||||
<id>spring-plugins-release</id>
|
|
||||||
<username>${env.ARTIFACTORY_USR}</username>
|
|
||||||
<password>${env.ARTIFACTORY_PSW}</password>
|
|
||||||
</server>
|
|
||||||
<server>
|
|
||||||
<id>spring-libs-snapshot</id>
|
|
||||||
<username>${env.ARTIFACTORY_USR}</username>
|
|
||||||
<password>${env.ARTIFACTORY_PSW}</password>
|
|
||||||
</server>
|
|
||||||
<server>
|
|
||||||
<id>spring-libs-milestone</id>
|
|
||||||
<username>${env.ARTIFACTORY_USR}</username>
|
|
||||||
<password>${env.ARTIFACTORY_PSW}</password>
|
|
||||||
</server>
|
|
||||||
<server>
|
|
||||||
<id>spring-libs-release</id>
|
|
||||||
<username>${env.ARTIFACTORY_USR}</username>
|
|
||||||
<password>${env.ARTIFACTORY_PSW}</password>
|
|
||||||
</server>
|
|
||||||
</servers>
|
|
||||||
|
|
||||||
</settings>
|
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.data</groupId>
|
<groupId>org.springframework.data</groupId>
|
||||||
<artifactId>spring-data-mongodb-parent</artifactId>
|
<artifactId>spring-data-mongodb-parent</artifactId>
|
||||||
<version>2.2.14.BUILD-SNAPSHOT</version>
|
<version>3.0.0.M2</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2021 the original author or authors.
|
* Copyright 2017-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2021 the original author or authors.
|
* Copyright 2017-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2021 the original author or authors.
|
* Copyright 2017-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2021 the original author or authors.
|
* Copyright 2017-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2021 the original author or authors.
|
* Copyright 2017-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2021 the original author or authors.
|
* Copyright 2017-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2021 the original author or authors.
|
* Copyright 2017-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.data</groupId>
|
<groupId>org.springframework.data</groupId>
|
||||||
<artifactId>spring-data-mongodb-parent</artifactId>
|
<artifactId>spring-data-mongodb-parent</artifactId>
|
||||||
<version>2.2.14.BUILD-SNAPSHOT</version>
|
<version>3.0.0.M2</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.data</groupId>
|
<groupId>org.springframework.data</groupId>
|
||||||
<artifactId>spring-data-mongodb-parent</artifactId>
|
<artifactId>spring-data-mongodb-parent</artifactId>
|
||||||
<version>2.2.14.BUILD-SNAPSHOT</version>
|
<version>3.0.0.M2</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2015-2021 the original author or authors.
|
* Copyright 2015-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018-2021 the original author or authors.
|
* Copyright 2018-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2021 the original author or authors.
|
* Copyright 2017-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2021 the original author or authors.
|
* Copyright 2010-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013-2021 the original author or authors.
|
* Copyright 2013-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -25,10 +25,8 @@ public class LazyLoadingException extends UncategorizedDataAccessException {
|
|||||||
private static final long serialVersionUID = -7089224903873220037L;
|
private static final long serialVersionUID = -7089224903873220037L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for LazyLoadingException.
|
* @param msg
|
||||||
*
|
* @param cause
|
||||||
* @param msg the detail message.
|
|
||||||
* @param cause the exception thrown by underlying data access API.
|
|
||||||
*/
|
*/
|
||||||
public LazyLoadingException(String msg, Throwable cause) {
|
public LazyLoadingException(String msg, Throwable cause) {
|
||||||
super(msg, cause);
|
super(msg, cause);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011-2021 the original author or authors.
|
* Copyright 2011-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018-2021 the original author or authors.
|
* Copyright 2018-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -79,7 +79,7 @@ public class MongoDatabaseUtils {
|
|||||||
* @param factory the {@link MongoDbFactory} to get the {@link MongoDatabase} from.
|
* @param factory the {@link MongoDbFactory} to get the {@link MongoDatabase} from.
|
||||||
* @return the {@link MongoDatabase} that is potentially associated with a transactional {@link ClientSession}.
|
* @return the {@link MongoDatabase} that is potentially associated with a transactional {@link ClientSession}.
|
||||||
*/
|
*/
|
||||||
public static MongoDatabase getDatabase(@Nullable String dbName, MongoDbFactory factory) {
|
public static MongoDatabase getDatabase(String dbName, MongoDbFactory factory) {
|
||||||
return doGetMongoDatabase(dbName, factory, SessionSynchronization.ON_ACTUAL_TRANSACTION);
|
return doGetMongoDatabase(dbName, factory, SessionSynchronization.ON_ACTUAL_TRANSACTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,13 +88,13 @@ public class MongoDatabaseUtils {
|
|||||||
* <p />
|
* <p />
|
||||||
* Registers a {@link MongoSessionSynchronization MongoDB specific transaction synchronization} within the current
|
* Registers a {@link MongoSessionSynchronization MongoDB specific transaction synchronization} within the current
|
||||||
* {@link Thread} if {@link TransactionSynchronizationManager#isSynchronizationActive() synchronization is active}.
|
* {@link Thread} if {@link TransactionSynchronizationManager#isSynchronizationActive() synchronization is active}.
|
||||||
*
|
*
|
||||||
* @param dbName the name of the {@link MongoDatabase} to get.
|
* @param dbName the name of the {@link MongoDatabase} to get.
|
||||||
* @param factory the {@link MongoDbFactory} to get the {@link MongoDatabase} from.
|
* @param factory the {@link MongoDbFactory} to get the {@link MongoDatabase} from.
|
||||||
* @param sessionSynchronization the synchronization to use. Must not be {@literal null}.
|
* @param sessionSynchronization the synchronization to use. Must not be {@literal null}.
|
||||||
* @return the {@link MongoDatabase} that is potentially associated with a transactional {@link ClientSession}.
|
* @return the {@link MongoDatabase} that is potentially associated with a transactional {@link ClientSession}.
|
||||||
*/
|
*/
|
||||||
public static MongoDatabase getDatabase(@Nullable String dbName, MongoDbFactory factory,
|
public static MongoDatabase getDatabase(String dbName, MongoDbFactory factory,
|
||||||
SessionSynchronization sessionSynchronization) {
|
SessionSynchronization sessionSynchronization) {
|
||||||
return doGetMongoDatabase(dbName, factory, sessionSynchronization);
|
return doGetMongoDatabase(dbName, factory, sessionSynchronization);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011-2021 the original author or authors.
|
* Copyright 2011-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -37,7 +37,7 @@ public interface MongoDbFactory extends CodecRegistryProvider, MongoSessionProvi
|
|||||||
/**
|
/**
|
||||||
* Creates a default {@link MongoDatabase} instance.
|
* Creates a default {@link MongoDatabase} instance.
|
||||||
*
|
*
|
||||||
* @return never {@literal null}.
|
* @return
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
MongoDatabase getDb() throws DataAccessException;
|
MongoDatabase getDb() throws DataAccessException;
|
||||||
@@ -46,7 +46,7 @@ public interface MongoDbFactory extends CodecRegistryProvider, MongoSessionProvi
|
|||||||
* Creates a {@link DB} instance to access the database with the given name.
|
* Creates a {@link DB} instance to access the database with the given name.
|
||||||
*
|
*
|
||||||
* @param dbName must not be {@literal null} or empty.
|
* @param dbName must not be {@literal null} or empty.
|
||||||
* @return never {@literal null}.
|
* @return
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
MongoDatabase getDb(String dbName) throws DataAccessException;
|
MongoDatabase getDb(String dbName) throws DataAccessException;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018-2021 the original author or authors.
|
* Copyright 2018-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018-2021 the original author or authors.
|
* Copyright 2018-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018-2021 the original author or authors.
|
* Copyright 2018-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018-2021 the original author or authors.
|
* Copyright 2018-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2021 the original author or authors.
|
* Copyright 2016-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -38,7 +38,7 @@ public interface ReactiveMongoDatabaseFactory extends CodecRegistryProvider {
|
|||||||
/**
|
/**
|
||||||
* Creates a default {@link MongoDatabase} instance.
|
* Creates a default {@link MongoDatabase} instance.
|
||||||
*
|
*
|
||||||
* @return never {@literal null}.
|
* @return
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
MongoDatabase getMongoDatabase() throws DataAccessException;
|
MongoDatabase getMongoDatabase() throws DataAccessException;
|
||||||
@@ -47,7 +47,7 @@ public interface ReactiveMongoDatabaseFactory extends CodecRegistryProvider {
|
|||||||
* Creates a {@link MongoDatabase} instance to access the database with the given name.
|
* Creates a {@link MongoDatabase} instance to access the database with the given name.
|
||||||
*
|
*
|
||||||
* @param dbName must not be {@literal null} or empty.
|
* @param dbName must not be {@literal null} or empty.
|
||||||
* @return never {@literal null}.
|
* @return
|
||||||
* @throws DataAccessException
|
* @throws DataAccessException
|
||||||
*/
|
*/
|
||||||
MongoDatabase getMongoDatabase(String dbName) throws DataAccessException;
|
MongoDatabase getMongoDatabase(String dbName) throws DataAccessException;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2019-2021 the original author or authors.
|
* Copyright 2019-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2019-2021 the original author or authors.
|
* Copyright 2019-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2019-2021 the original author or authors.
|
* Copyright 2019-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -110,7 +110,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction
|
|||||||
this.options = options;
|
this.options = options;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.springframework.transaction.reactive.AbstractReactiveTransactionManager#doGetTransaction(org.springframework.transaction.reactive.TransactionSynchronizationManager)
|
* @see org.springframework.transaction.reactive.AbstractReactiveTransactionManager#doGetTransaction(org.springframework.transaction.reactive.TransactionSynchronizationManager)
|
||||||
*/
|
*/
|
||||||
@@ -123,7 +123,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction
|
|||||||
return new ReactiveMongoTransactionObject(resourceHolder);
|
return new ReactiveMongoTransactionObject(resourceHolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.springframework.transaction.reactive.AbstractReactiveTransactionManager#isExistingTransaction(java.lang.Object)
|
* @see org.springframework.transaction.reactive.AbstractReactiveTransactionManager#isExistingTransaction(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
@@ -132,7 +132,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction
|
|||||||
return extractMongoTransaction(transaction).hasResourceHolder();
|
return extractMongoTransaction(transaction).hasResourceHolder();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.springframework.transaction.reactive.AbstractReactiveTransactionManager#doBegin(org.springframework.transaction.reactive.TransactionSynchronizationManager, java.lang.Object, org.springframework.transaction.TransactionDefinition)
|
* @see org.springframework.transaction.reactive.AbstractReactiveTransactionManager#doBegin(org.springframework.transaction.reactive.TransactionSynchronizationManager, java.lang.Object, org.springframework.transaction.TransactionDefinition)
|
||||||
*/
|
*/
|
||||||
@@ -175,7 +175,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.springframework.transaction.reactive.AbstractReactiveTransactionManager#doSuspend(org.springframework.transaction.reactive.TransactionSynchronizationManager, java.lang.Object)
|
* @see org.springframework.transaction.reactive.AbstractReactiveTransactionManager#doSuspend(org.springframework.transaction.reactive.TransactionSynchronizationManager, java.lang.Object)
|
||||||
*/
|
*/
|
||||||
@@ -192,7 +192,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.springframework.transaction.reactive.AbstractReactiveTransactionManager#doResume(org.springframework.transaction.reactive.TransactionSynchronizationManager, java.lang.Object, java.lang.Object)
|
* @see org.springframework.transaction.reactive.AbstractReactiveTransactionManager#doResume(org.springframework.transaction.reactive.TransactionSynchronizationManager, java.lang.Object, java.lang.Object)
|
||||||
*/
|
*/
|
||||||
@@ -203,7 +203,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction
|
|||||||
.fromRunnable(() -> synchronizationManager.bindResource(getRequiredDatabaseFactory(), suspendedResources));
|
.fromRunnable(() -> synchronizationManager.bindResource(getRequiredDatabaseFactory(), suspendedResources));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.springframework.transaction.reactive.AbstractReactiveTransactionManager#doCommit(org.springframework.transaction.reactive.TransactionSynchronizationManager, org.springframework.transaction.reactive.GenericReactiveTransaction)
|
* @see org.springframework.transaction.reactive.AbstractReactiveTransactionManager#doCommit(org.springframework.transaction.reactive.TransactionSynchronizationManager, org.springframework.transaction.reactive.GenericReactiveTransaction)
|
||||||
*/
|
*/
|
||||||
@@ -243,7 +243,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction
|
|||||||
return transactionObject.commitTransaction();
|
return transactionObject.commitTransaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.springframework.transaction.reactive.AbstractReactiveTransactionManager#doRollback(org.springframework.transaction.reactive.TransactionSynchronizationManager, org.springframework.transaction.reactive.GenericReactiveTransaction)
|
* @see org.springframework.transaction.reactive.AbstractReactiveTransactionManager#doRollback(org.springframework.transaction.reactive.TransactionSynchronizationManager, org.springframework.transaction.reactive.GenericReactiveTransaction)
|
||||||
*/
|
*/
|
||||||
@@ -268,7 +268,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.springframework.transaction.reactive.AbstractReactiveTransactionManager#doSetRollbackOnly(org.springframework.transaction.reactive.TransactionSynchronizationManager, org.springframework.transaction.reactive.GenericReactiveTransaction)
|
* @see org.springframework.transaction.reactive.AbstractReactiveTransactionManager#doSetRollbackOnly(org.springframework.transaction.reactive.TransactionSynchronizationManager, org.springframework.transaction.reactive.GenericReactiveTransaction)
|
||||||
*/
|
*/
|
||||||
@@ -282,7 +282,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.springframework.transaction.reactive.AbstractReactiveTransactionManager#doCleanupAfterCompletion(org.springframework.transaction.reactive.TransactionSynchronizationManager, java.lang.Object)
|
* @see org.springframework.transaction.reactive.AbstractReactiveTransactionManager#doCleanupAfterCompletion(org.springframework.transaction.reactive.TransactionSynchronizationManager, java.lang.Object)
|
||||||
*/
|
*/
|
||||||
@@ -509,7 +509,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction
|
|||||||
return session;
|
return session;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.springframework.transaction.support.SmartTransactionObject#isRollbackOnly()
|
* @see org.springframework.transaction.support.SmartTransactionObject#isRollbackOnly()
|
||||||
*/
|
*/
|
||||||
@@ -518,7 +518,7 @@ public class ReactiveMongoTransactionManager extends AbstractReactiveTransaction
|
|||||||
return this.resourceHolder != null && this.resourceHolder.isRollbackOnly();
|
return this.resourceHolder != null && this.resourceHolder.isRollbackOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.springframework.transaction.support.SmartTransactionObject#flush()
|
* @see org.springframework.transaction.support.SmartTransactionObject#flush()
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018-2021 the original author or authors.
|
* Copyright 2018-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018-2021 the original author or authors.
|
* Copyright 2018-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2021 the original author or authors.
|
* Copyright 2010-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018-2021 the original author or authors.
|
* Copyright 2018-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011-2021 the original author or authors.
|
* Copyright 2011-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2021 the original author or authors.
|
* Copyright 2016-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011-2021 the original author or authors.
|
* Copyright 2011-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013-2021 the original author or authors.
|
* Copyright 2013-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -42,21 +42,21 @@ public @interface EnableMongoAuditing {
|
|||||||
/**
|
/**
|
||||||
* Configures the {@link AuditorAware} bean to be used to lookup the current principal.
|
* Configures the {@link AuditorAware} bean to be used to lookup the current principal.
|
||||||
*
|
*
|
||||||
* @return empty {@link String} by default.
|
* @return
|
||||||
*/
|
*/
|
||||||
String auditorAwareRef() default "";
|
String auditorAwareRef() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configures whether the creation and modification dates are set. Defaults to {@literal true}.
|
* Configures whether the creation and modification dates are set. Defaults to {@literal true}.
|
||||||
*
|
*
|
||||||
* @return {@literal true} by default.
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean setDates() default true;
|
boolean setDates() default true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configures whether the entity shall be marked as modified on creation. Defaults to {@literal true}.
|
* Configures whether the entity shall be marked as modified on creation. Defaults to {@literal true}.
|
||||||
*
|
*
|
||||||
* @return {@literal true} by default.
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean modifyOnCreate() default true;
|
boolean modifyOnCreate() default true;
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ public @interface EnableMongoAuditing {
|
|||||||
* Configures a {@link DateTimeProvider} bean name that allows customizing the {@link org.joda.time.DateTime} to be
|
* Configures a {@link DateTimeProvider} bean name that allows customizing the {@link org.joda.time.DateTime} to be
|
||||||
* used for setting creation and modification dates.
|
* used for setting creation and modification dates.
|
||||||
*
|
*
|
||||||
* @return empty {@link String} by default.
|
* @return
|
||||||
*/
|
*/
|
||||||
String dateTimeProviderRef() default "";
|
String dateTimeProviderRef() default "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2015-2021 the original author or authors.
|
* Copyright 2015-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013-2021 the original author or authors.
|
* Copyright 2013-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011-2021 the original author or authors.
|
* Copyright 2011-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2013-2021 the original author or authors.
|
* Copyright 2013-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2015-2021 the original author or authors.
|
* Copyright 2015-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2021 the original author or authors.
|
* Copyright 2016-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -89,7 +89,7 @@ public abstract class MongoConfigurationSupport {
|
|||||||
/**
|
/**
|
||||||
* Register custom {@link Converter}s in a {@link CustomConversions} object if required. These
|
* Register custom {@link Converter}s in a {@link CustomConversions} object if required. These
|
||||||
* {@link CustomConversions} will be registered with the {@link #mappingMongoConverter()} and
|
* {@link CustomConversions} will be registered with the {@link #mappingMongoConverter()} and
|
||||||
* {@link MongoMappingContext}. Returns an empty {@link MongoCustomConversions} instance by default.
|
* {@link #mongoMappingContext()}. Returns an empty {@link MongoCustomConversions} instance by default.
|
||||||
*
|
*
|
||||||
* @return must not be {@literal null}.
|
* @return must not be {@literal null}.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2015-2021 the original author or authors.
|
* Copyright 2015-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011-2021 the original author or authors.
|
* Copyright 2011-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011-2021 the original author or authors.
|
* Copyright 2011-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011-2021 the original author or authors.
|
* Copyright 2011-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011-2021 the original author or authors.
|
* Copyright 2011-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011-2021 the original author or authors.
|
* Copyright 2011-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2015-2021 the original author or authors.
|
* Copyright 2015-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011-2021 the original author or authors.
|
* Copyright 2011-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011-2021 the original author or authors.
|
* Copyright 2011-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018-2021 the original author or authors.
|
* Copyright 2018-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2015-2021 the original author or authors.
|
* Copyright 2015-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -94,6 +94,7 @@ public interface BulkOperations {
|
|||||||
* Add a list of updates to the bulk operation. For each update request, all matching documents are updated.
|
* Add a list of updates to the bulk operation. For each update request, all matching documents are updated.
|
||||||
*
|
*
|
||||||
* @param updates Update operations to perform.
|
* @param updates Update operations to perform.
|
||||||
|
* @return The bulk operation.
|
||||||
* @return the current {@link BulkOperations} instance with the update added, will never be {@literal null}.
|
* @return the current {@link BulkOperations} instance with the update added, will never be {@literal null}.
|
||||||
*/
|
*/
|
||||||
BulkOperations updateMulti(List<Pair<Query, Update>> updates);
|
BulkOperations updateMulti(List<Pair<Query, Update>> updates);
|
||||||
@@ -104,6 +105,7 @@ public interface BulkOperations {
|
|||||||
*
|
*
|
||||||
* @param query Update criteria.
|
* @param query Update criteria.
|
||||||
* @param update Update operation to perform.
|
* @param update Update operation to perform.
|
||||||
|
* @return The bulk operation.
|
||||||
* @return the current {@link BulkOperations} instance with the update added, will never be {@literal null}.
|
* @return the current {@link BulkOperations} instance with the update added, will never be {@literal null}.
|
||||||
*/
|
*/
|
||||||
BulkOperations upsert(Query query, Update update);
|
BulkOperations upsert(Query query, Update update);
|
||||||
@@ -113,6 +115,7 @@ public interface BulkOperations {
|
|||||||
* else an insert.
|
* else an insert.
|
||||||
*
|
*
|
||||||
* @param updates Updates/insert operations to perform.
|
* @param updates Updates/insert operations to perform.
|
||||||
|
* @return The bulk operation.
|
||||||
* @return the current {@link BulkOperations} instance with the update added, will never be {@literal null}.
|
* @return the current {@link BulkOperations} instance with the update added, will never be {@literal null}.
|
||||||
*/
|
*/
|
||||||
BulkOperations upsert(List<Pair<Query, Update>> updates);
|
BulkOperations upsert(List<Pair<Query, Update>> updates);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018-2021 the original author or authors.
|
* Copyright 2018-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018-2021 the original author or authors.
|
* Copyright 2018-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2021 the original author or authors.
|
* Copyright 2010-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -29,7 +29,7 @@ import com.mongodb.client.MongoCollection;
|
|||||||
* @author Grame Rocher
|
* @author Grame Rocher
|
||||||
* @author Oliver Gierke
|
* @author Oliver Gierke
|
||||||
* @author John Brisbin
|
* @author John Brisbin
|
||||||
* @author Christoph Strobl
|
* @auhtor Christoph Strobl
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public interface CollectionCallback<T> {
|
public interface CollectionCallback<T> {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2021 the original author or authors.
|
* Copyright 2010-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -95,7 +95,7 @@ public class CollectionOptions {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create new {@link CollectionOptions} with already given settings and capped set to {@literal true}. <br />
|
* Create new {@link CollectionOptions} with already given settings and capped set to {@literal true}. <br />
|
||||||
* <strong>NOTE</strong> Using capped collections requires defining {@link #size(long)}.
|
* <strong>NOTE</strong> Using capped collections requires defining {@link #size(int)}.
|
||||||
*
|
*
|
||||||
* @return new {@link CollectionOptions}.
|
* @return new {@link CollectionOptions}.
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
|
|||||||
@@ -0,0 +1,227 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2019-2020 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.
|
||||||
|
*/
|
||||||
|
package org.springframework.data.mongodb.core;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.bson.Document;
|
||||||
|
|
||||||
|
import org.springframework.data.geo.Point;
|
||||||
|
import org.springframework.lang.Nullable;
|
||||||
|
import org.springframework.util.ObjectUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Value object representing a count query. Count queries using {@code $near} or {@code $nearSphere} require a rewrite
|
||||||
|
* to {@code $geoWithin}.
|
||||||
|
*
|
||||||
|
* @author Christoph Strobl
|
||||||
|
* @author Mark Paluch
|
||||||
|
* @since 3.0
|
||||||
|
*/
|
||||||
|
class CountQuery {
|
||||||
|
|
||||||
|
private Document source;
|
||||||
|
|
||||||
|
private CountQuery(Document source) {
|
||||||
|
this.source = source;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CountQuery of(Document source) {
|
||||||
|
return new CountQuery(source);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the query {@link Document} that can be used with {@code countDocuments()}. Potentially rewrites the query
|
||||||
|
* to be usable with {@code countDocuments()}.
|
||||||
|
*
|
||||||
|
* @return the query {@link Document} that can be used with {@code countDocuments()}.
|
||||||
|
*/
|
||||||
|
public Document toQueryDocument() {
|
||||||
|
|
||||||
|
if (!requiresRewrite(source)) {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
|
Document target = new Document();
|
||||||
|
|
||||||
|
for (Map.Entry<String, Object> entry : source.entrySet()) {
|
||||||
|
|
||||||
|
if (entry.getValue() instanceof Document && requiresRewrite(entry.getValue())) {
|
||||||
|
|
||||||
|
Document theValue = (Document) entry.getValue();
|
||||||
|
target.putAll(createGeoWithin(entry.getKey(), theValue, source.get("$and")));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entry.getValue() instanceof Collection && requiresRewrite(entry.getValue())) {
|
||||||
|
|
||||||
|
Collection<?> source = (Collection<?>) entry.getValue();
|
||||||
|
|
||||||
|
target.put(entry.getKey(), rewriteCollection(source));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("$and".equals(entry.getKey()) && target.containsKey("$and")) {
|
||||||
|
// Expect $and to be processed with Document and createGeoWithin.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
target.put(entry.getKey(), entry.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param valueToInspect
|
||||||
|
* @return {@code true} if the enclosing element needs to be rewritten.
|
||||||
|
*/
|
||||||
|
private boolean requiresRewrite(Object valueToInspect) {
|
||||||
|
|
||||||
|
if (valueToInspect instanceof Document) {
|
||||||
|
return requiresRewrite((Document) valueToInspect);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (valueToInspect instanceof Collection) {
|
||||||
|
return requiresRewrite((Collection) valueToInspect);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean requiresRewrite(Collection<?> collection) {
|
||||||
|
|
||||||
|
for (Object o : collection) {
|
||||||
|
if (o instanceof Document && requiresRewrite((Document) o)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean requiresRewrite(Document document) {
|
||||||
|
|
||||||
|
if (containsNear(document)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Object entry : document.values()) {
|
||||||
|
|
||||||
|
if (requiresRewrite(entry)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Collection<Object> rewriteCollection(Collection<?> source) {
|
||||||
|
|
||||||
|
Collection<Object> rewrittenCollection = new ArrayList<>(source.size());
|
||||||
|
|
||||||
|
for (Object item : source) {
|
||||||
|
if (item instanceof Document && requiresRewrite(item)) {
|
||||||
|
rewrittenCollection.add(CountQuery.of((Document) item).toQueryDocument());
|
||||||
|
} else {
|
||||||
|
rewrittenCollection.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return rewrittenCollection;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rewrite the near query for field {@code key} to {@code $geoWithin}.
|
||||||
|
*
|
||||||
|
* @param key the queried field.
|
||||||
|
* @param source source {@link Document}.
|
||||||
|
* @param $and potentially existing {@code $and} condition.
|
||||||
|
* @return the rewritten query {@link Document}.
|
||||||
|
*/
|
||||||
|
private static Document createGeoWithin(String key, Document source, @Nullable Object $and) {
|
||||||
|
|
||||||
|
boolean spheric = source.containsKey("$nearSphere");
|
||||||
|
Object $near = spheric ? source.get("$nearSphere") : source.get("$near");
|
||||||
|
|
||||||
|
Number maxDistance = source.containsKey("$maxDistance") ? (Number) source.get("$maxDistance") : Double.MAX_VALUE;
|
||||||
|
List<Object> $centerMax = Arrays.asList(toCenterCoordinates($near), maxDistance);
|
||||||
|
Document $geoWithinMax = new Document("$geoWithin",
|
||||||
|
new Document(spheric ? "$centerSphere" : "$center", $centerMax));
|
||||||
|
|
||||||
|
if (!containsNearWithMinDistance(source)) {
|
||||||
|
return new Document(key, $geoWithinMax);
|
||||||
|
}
|
||||||
|
|
||||||
|
Number minDistance = (Number) source.get("$minDistance");
|
||||||
|
List<Object> $centerMin = Arrays.asList(toCenterCoordinates($near), minDistance);
|
||||||
|
Document $geoWithinMin = new Document("$geoWithin",
|
||||||
|
new Document(spheric ? "$centerSphere" : "$center", $centerMin));
|
||||||
|
|
||||||
|
List<Document> criteria = new ArrayList<>();
|
||||||
|
|
||||||
|
if ($and != null) {
|
||||||
|
if ($and instanceof Collection) {
|
||||||
|
criteria.addAll((Collection) $and);
|
||||||
|
} else {
|
||||||
|
throw new IllegalArgumentException(
|
||||||
|
"Cannot rewrite query as it contains an '$and' element that is not a Collection!: Offending element: "
|
||||||
|
+ $and);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
criteria.add(new Document("$nor", Collections.singletonList(new Document(key, $geoWithinMin))));
|
||||||
|
criteria.add(new Document(key, $geoWithinMax));
|
||||||
|
return new Document("$and", criteria);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean containsNear(Document source) {
|
||||||
|
return source.containsKey("$near") || source.containsKey("$nearSphere");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean containsNearWithMinDistance(Document source) {
|
||||||
|
|
||||||
|
if (!containsNear(source)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return source.containsKey("$minDistance");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Object toCenterCoordinates(Object value) {
|
||||||
|
|
||||||
|
if (ObjectUtils.isArray(value)) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value instanceof Point) {
|
||||||
|
return Arrays.asList(((Point) value).getX(), ((Point) value).getY());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value instanceof Document && ((Document) value).containsKey("x")) {
|
||||||
|
|
||||||
|
Document point = (Document) value;
|
||||||
|
return Arrays.asList(point.get("x"), point.get("y"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2021 the original author or authors.
|
* Copyright 2002-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -43,10 +43,9 @@ public interface CursorPreparer extends ReadPreferenceAware {
|
|||||||
/**
|
/**
|
||||||
* Prepare the given cursor (apply limits, skips and so on). Returns the prepared cursor.
|
* Prepare the given cursor (apply limits, skips and so on). Returns the prepared cursor.
|
||||||
*
|
*
|
||||||
* @param iterable must not be {@literal null}.
|
* @param cursor
|
||||||
* @return never {@literal null}.
|
|
||||||
*/
|
*/
|
||||||
FindIterable<Document> prepare(FindIterable<Document> iterable);
|
FindIterable<Document> prepare(FindIterable<Document> cursor);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply query specific settings to {@link MongoCollection} and initate a find operation returning a
|
* Apply query specific settings to {@link MongoCollection} and initate a find operation returning a
|
||||||
@@ -54,7 +53,7 @@ public interface CursorPreparer extends ReadPreferenceAware {
|
|||||||
*
|
*
|
||||||
* @param collection must not be {@literal null}.
|
* @param collection must not be {@literal null}.
|
||||||
* @param find must not be {@literal null}.
|
* @param find must not be {@literal null}.
|
||||||
* @return never {@literal null}.
|
* @return
|
||||||
* @throws IllegalArgumentException if one of the required arguments is {@literal null}.
|
* @throws IllegalArgumentException if one of the required arguments is {@literal null}.
|
||||||
* @since 2.2
|
* @since 2.2
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2021 the original author or authors.
|
* Copyright 2010-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2015-2021 the original author or authors.
|
* Copyright 2015-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011-2021 the original author or authors.
|
* Copyright 2011-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2021 the original author or authors.
|
* Copyright 2016-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2021 the original author or authors.
|
* Copyright 2016-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014-2021 the original author or authors.
|
* Copyright 2014-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2015-2021 the original author or authors.
|
* Copyright 2015-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2021 the original author or authors.
|
* Copyright 2010-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -23,7 +23,7 @@ import com.mongodb.MongoException;
|
|||||||
/**
|
/**
|
||||||
* An interface used by {@link MongoTemplate} for processing documents returned from a MongoDB query on a per-document
|
* An interface used by {@link MongoTemplate} for processing documents returned from a MongoDB query on a per-document
|
||||||
* basis. Implementations of this interface perform the actual work of prcoessing each document but don't need to worry
|
* basis. Implementations of this interface perform the actual work of prcoessing each document but don't need to worry
|
||||||
* about exception handling. {@link MongoException}s will be caught and translated by the calling MongoTemplate An
|
* about exception handling. {@MongoException}s will be caught and translated by the calling MongoTemplate An
|
||||||
* DocumentCallbackHandler is typically stateful: It keeps the result state within the object, to be available later for
|
* DocumentCallbackHandler is typically stateful: It keeps the result state within the object, to be available later for
|
||||||
* later inspection.
|
* later inspection.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018-2021 the original author or authors.
|
* Copyright 2018-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -66,7 +66,7 @@ class EntityOperations {
|
|||||||
* Creates a new {@link Entity} for the given bean.
|
* Creates a new {@link Entity} for the given bean.
|
||||||
*
|
*
|
||||||
* @param entity must not be {@literal null}.
|
* @param entity must not be {@literal null}.
|
||||||
* @return new instance of {@link Entity}.
|
* @return
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
public <T> Entity<T> forEntity(T entity) {
|
public <T> Entity<T> forEntity(T entity) {
|
||||||
@@ -89,7 +89,7 @@ class EntityOperations {
|
|||||||
*
|
*
|
||||||
* @param entity must not be {@literal null}.
|
* @param entity must not be {@literal null}.
|
||||||
* @param conversionService must not be {@literal null}.
|
* @param conversionService must not be {@literal null}.
|
||||||
* @return new instance of {@link AdaptibleEntity}.
|
* @return
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
public <T> AdaptibleEntity<T> forEntity(T entity, ConversionService conversionService) {
|
public <T> AdaptibleEntity<T> forEntity(T entity, ConversionService conversionService) {
|
||||||
@@ -108,10 +108,6 @@ class EntityOperations {
|
|||||||
return AdaptibleMappedEntity.of(entity, context, conversionService);
|
return AdaptibleMappedEntity.of(entity, context, conversionService);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param entityClass should not be null.
|
|
||||||
* @return the {@link MongoPersistentEntity#getCollection() collection name}.
|
|
||||||
*/
|
|
||||||
public String determineCollectionName(@Nullable Class<?> entityClass) {
|
public String determineCollectionName(@Nullable Class<?> entityClass) {
|
||||||
|
|
||||||
if (entityClass == null) {
|
if (entityClass == null) {
|
||||||
@@ -142,7 +138,7 @@ class EntityOperations {
|
|||||||
* {@code _id} if no identifier property can be found.
|
* {@code _id} if no identifier property can be found.
|
||||||
*
|
*
|
||||||
* @param type must not be {@literal null}.
|
* @param type must not be {@literal null}.
|
||||||
* @return never {@literal null}.
|
* @return
|
||||||
*/
|
*/
|
||||||
public String getIdPropertyName(Class<?> type) {
|
public String getIdPropertyName(Class<?> type) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2021 the original author or authors.
|
* Copyright 2017-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -88,10 +88,10 @@ public interface ExecutableAggregationOperation {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply pipeline operations as specified and stream all matching elements. <br />
|
* Apply pipeline operations as specified and stream all matching elements. <br />
|
||||||
* Returns a {@link CloseableIterator} that wraps the a Mongo DB {@link com.mongodb.client.FindIterable}
|
* Returns a {@link CloseableIterator} that wraps the a Mongo DB {@link com.mongodb.Cursor}
|
||||||
*
|
*
|
||||||
* @return a {@link CloseableIterator} that wraps the a Mongo DB {@link com.mongodb.client.FindIterable} that needs
|
* @return a {@link CloseableIterator} that wraps the a Mongo DB {@link com.mongodb.Cursor} that needs to be closed.
|
||||||
* to be closed. Never {@literal null}.
|
* Never {@literal null}.
|
||||||
*/
|
*/
|
||||||
CloseableIterator<T> stream();
|
CloseableIterator<T> stream();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2021 the original author or authors.
|
* Copyright 2017-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2021 the original author or authors.
|
* Copyright 2017-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -117,8 +117,8 @@ public interface ExecutableFindOperation {
|
|||||||
/**
|
/**
|
||||||
* Stream all matching elements.
|
* Stream all matching elements.
|
||||||
*
|
*
|
||||||
* @return a {@link Stream} that wraps the a Mongo DB {@link com.mongodb.client.FindIterable} that needs to be
|
* @return a {@link Stream} that wraps the a Mongo DB {@link com.mongodb.Cursor} that needs to be closed. Never
|
||||||
* closed. Never {@literal null}.
|
* {@literal null}.
|
||||||
*/
|
*/
|
||||||
Stream<T> stream();
|
Stream<T> stream();
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2021 the original author or authors.
|
* Copyright 2017-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.springframework.data.mongodb.core;
|
package org.springframework.data.mongodb.core;
|
||||||
|
|
||||||
|
import com.mongodb.ReadPreference;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -25,7 +26,6 @@ import java.util.Optional;
|
|||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import org.bson.Document;
|
import org.bson.Document;
|
||||||
|
|
||||||
import org.springframework.dao.IncorrectResultSizeDataAccessException;
|
import org.springframework.dao.IncorrectResultSizeDataAccessException;
|
||||||
import org.springframework.data.mongodb.core.query.NearQuery;
|
import org.springframework.data.mongodb.core.query.NearQuery;
|
||||||
import org.springframework.data.mongodb.core.query.Query;
|
import org.springframework.data.mongodb.core.query.Query;
|
||||||
@@ -37,7 +37,6 @@ import org.springframework.util.Assert;
|
|||||||
import org.springframework.util.ObjectUtils;
|
import org.springframework.util.ObjectUtils;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
import com.mongodb.ReadPreference;
|
|
||||||
import com.mongodb.client.FindIterable;
|
import com.mongodb.client.FindIterable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -258,9 +257,9 @@ class ExecutableFindOperationSupport implements ExecutableFindOperation {
|
|||||||
* @see org.springframework.data.mongodb.core.CursorPreparer#prepare(com.mongodb.clientFindIterable)
|
* @see org.springframework.data.mongodb.core.CursorPreparer#prepare(com.mongodb.clientFindIterable)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public FindIterable<Document> prepare(FindIterable<Document> iterable) {
|
public FindIterable<Document> prepare(FindIterable<Document> cursor) {
|
||||||
|
|
||||||
FindIterable<Document> target = delegate != null ? delegate.prepare(iterable) : iterable;
|
FindIterable<Document> target = delegate != null ? delegate.prepare(cursor) : cursor;
|
||||||
return limit.map(target::limit).orElse(target);
|
return limit.map(target::limit).orElse(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2021 the original author or authors.
|
* Copyright 2017-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2021 the original author or authors.
|
* Copyright 2017-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018-2021 the original author or authors.
|
* Copyright 2018-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018-2021 the original author or authors.
|
* Copyright 2018-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2021 the original author or authors.
|
* Copyright 2017-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2021 the original author or authors.
|
* Copyright 2017-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2021 the original author or authors.
|
* Copyright 2017-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -17,8 +17,10 @@ package org.springframework.data.mongodb.core;
|
|||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import org.springframework.data.mongodb.core.aggregation.AggregationUpdate;
|
||||||
import org.springframework.data.mongodb.core.query.Query;
|
import org.springframework.data.mongodb.core.query.Query;
|
||||||
import org.springframework.data.mongodb.core.query.Update;
|
import org.springframework.data.mongodb.core.query.Update;
|
||||||
|
import org.springframework.data.mongodb.core.query.UpdateDefinition;
|
||||||
import org.springframework.lang.Nullable;
|
import org.springframework.lang.Nullable;
|
||||||
|
|
||||||
import com.mongodb.client.result.UpdateResult;
|
import com.mongodb.client.result.UpdateResult;
|
||||||
@@ -151,13 +153,16 @@ public interface ExecutableUpdateOperation {
|
|||||||
interface UpdateWithUpdate<T> {
|
interface UpdateWithUpdate<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the {@link Update} to be applied.
|
* Set the {@link UpdateDefinition} to be applied.
|
||||||
*
|
*
|
||||||
* @param update must not be {@literal null}.
|
* @param update must not be {@literal null}.
|
||||||
* @return new instance of {@link TerminatingUpdate}.
|
* @return new instance of {@link TerminatingUpdate}.
|
||||||
* @throws IllegalArgumentException if update is {@literal null}.
|
* @throws IllegalArgumentException if update is {@literal null}.
|
||||||
|
* @since 3.0
|
||||||
|
* @see Update
|
||||||
|
* @see AggregationUpdate
|
||||||
*/
|
*/
|
||||||
TerminatingUpdate<T> apply(Update update);
|
TerminatingUpdate<T> apply(UpdateDefinition update);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specify {@code replacement} object.
|
* Specify {@code replacement} object.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2021 the original author or authors.
|
* Copyright 2017-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -21,7 +21,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.experimental.FieldDefaults;
|
import lombok.experimental.FieldDefaults;
|
||||||
|
|
||||||
import org.springframework.data.mongodb.core.query.Query;
|
import org.springframework.data.mongodb.core.query.Query;
|
||||||
import org.springframework.data.mongodb.core.query.Update;
|
import org.springframework.data.mongodb.core.query.UpdateDefinition;
|
||||||
import org.springframework.lang.Nullable;
|
import org.springframework.lang.Nullable;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
@@ -67,7 +67,7 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation {
|
|||||||
@NonNull MongoTemplate template;
|
@NonNull MongoTemplate template;
|
||||||
@NonNull Class domainType;
|
@NonNull Class domainType;
|
||||||
Query query;
|
Query query;
|
||||||
@Nullable Update update;
|
@Nullable UpdateDefinition update;
|
||||||
@Nullable String collection;
|
@Nullable String collection;
|
||||||
@Nullable FindAndModifyOptions findAndModifyOptions;
|
@Nullable FindAndModifyOptions findAndModifyOptions;
|
||||||
@Nullable FindAndReplaceOptions findAndReplaceOptions;
|
@Nullable FindAndReplaceOptions findAndReplaceOptions;
|
||||||
@@ -76,10 +76,10 @@ class ExecutableUpdateOperationSupport implements ExecutableUpdateOperation {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.springframework.data.mongodb.core.ExecutableUpdateOperation.UpdateWithUpdate#apply(Update)
|
* @see org.springframework.data.mongodb.core.ExecutableUpdateOperation.UpdateWithUpdate#apply(org.springframework.data.mongodb.core.query.UpdateDefinition)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public TerminatingUpdate<T> apply(Update update) {
|
public TerminatingUpdate<T> apply(UpdateDefinition update) {
|
||||||
|
|
||||||
Assert.notNull(update, "Update must not be null!");
|
Assert.notNull(update, "Update must not be null!");
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2021 the original author or authors.
|
* Copyright 2010-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -78,7 +78,7 @@ public class FindAndModifyOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create new {@link FindAndModifyOptions} based on option of given {@literal source}.
|
* Create new {@link FindAndModifyOptions} based on option of given {@litearl source}.
|
||||||
*
|
*
|
||||||
* @param source can be {@literal null}.
|
* @param source can be {@literal null}.
|
||||||
* @return new instance of {@link FindAndModifyOptions}.
|
* @return new instance of {@link FindAndModifyOptions}.
|
||||||
@@ -117,8 +117,8 @@ public class FindAndModifyOptions {
|
|||||||
/**
|
/**
|
||||||
* Define the {@link Collation} specifying language-specific rules for string comparison.
|
* Define the {@link Collation} specifying language-specific rules for string comparison.
|
||||||
*
|
*
|
||||||
* @param collation can be {@literal null}.
|
* @param collation
|
||||||
* @return this.
|
* @return
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
*/
|
*/
|
||||||
public FindAndModifyOptions collation(@Nullable Collation collation) {
|
public FindAndModifyOptions collation(@Nullable Collation collation) {
|
||||||
@@ -142,7 +142,7 @@ public class FindAndModifyOptions {
|
|||||||
/**
|
/**
|
||||||
* Get the {@link Collation} specifying language-specific rules for string comparison.
|
* Get the {@link Collation} specifying language-specific rules for string comparison.
|
||||||
*
|
*
|
||||||
* @return never {@literal null}.
|
* @return
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
*/
|
*/
|
||||||
public Optional<Collation> getCollation() {
|
public Optional<Collation> getCollation() {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018-2021 the original author or authors.
|
* Copyright 2018-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -116,7 +116,7 @@ public class FindAndReplaceOptions {
|
|||||||
/**
|
/**
|
||||||
* Get the bit indicating to return the replacement document.
|
* Get the bit indicating to return the replacement document.
|
||||||
*
|
*
|
||||||
* @return {@literal true} if set.
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean isReturnNew() {
|
public boolean isReturnNew() {
|
||||||
return returnNew;
|
return returnNew;
|
||||||
@@ -125,7 +125,7 @@ public class FindAndReplaceOptions {
|
|||||||
/**
|
/**
|
||||||
* Get the bit indicating if to create a new document if not exists.
|
* Get the bit indicating if to create a new document if not exists.
|
||||||
*
|
*
|
||||||
* @return {@literal true} if set.
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean isUpsert() {
|
public boolean isUpsert() {
|
||||||
return upsert;
|
return upsert;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2021 the original author or authors.
|
* Copyright 2016-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -54,7 +54,7 @@ public interface FindPublisherPreparer extends ReadPreferenceAware {
|
|||||||
*
|
*
|
||||||
* @param collection must not be {@literal null}.
|
* @param collection must not be {@literal null}.
|
||||||
* @param find must not be {@literal null}.
|
* @param find must not be {@literal null}.
|
||||||
* @return never {@literal null}.
|
* @return
|
||||||
* @throws IllegalArgumentException if one of the required arguments is {@literal null}.
|
* @throws IllegalArgumentException if one of the required arguments is {@literal null}.
|
||||||
* @since 2.2
|
* @since 2.2
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2017-2021 the original author or authors.
|
* Copyright 2017-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2021 the original author or authors.
|
* Copyright 2016-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -47,7 +47,7 @@ class GeoCommandStatistics {
|
|||||||
* Creates a new {@link GeoCommandStatistics} from the given command result extracting the statistics.
|
* Creates a new {@link GeoCommandStatistics} from the given command result extracting the statistics.
|
||||||
*
|
*
|
||||||
* @param commandResult must not be {@literal null}.
|
* @param commandResult must not be {@literal null}.
|
||||||
* @return never {@literal null}.
|
* @return
|
||||||
*/
|
*/
|
||||||
public static GeoCommandStatistics from(Document commandResult) {
|
public static GeoCommandStatistics from(Document commandResult) {
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ class GeoCommandStatistics {
|
|||||||
* Returns the average distance reported by the command result. Mitigating a removal of the field in case the command
|
* Returns the average distance reported by the command result. Mitigating a removal of the field in case the command
|
||||||
* didn't return any result introduced in MongoDB 3.2 RC1.
|
* didn't return any result introduced in MongoDB 3.2 RC1.
|
||||||
*
|
*
|
||||||
* @return never {@literal null}, uses {@link Double#NaN} if {@literal avgDistance} does not exist.
|
* @return
|
||||||
* @see <a href="https://jira.mongodb.org/browse/SERVER-21024">MongoDB Jira SERVER-21024</a>
|
* @see <a href="https://jira.mongodb.org/browse/SERVER-21024">MongoDB Jira SERVER-21024</a>
|
||||||
*/
|
*/
|
||||||
public double getAverageDistance() {
|
public double getAverageDistance() {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2021 the original author or authors.
|
* Copyright 2016-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2018-2021 the original author or authors.
|
* Copyright 2018-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2019-2021 the original author or authors.
|
* Copyright 2019-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011-2021 the original author or authors.
|
* Copyright 2011-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011-2021 the original author or authors.
|
* Copyright 2011-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011-2021 the original author or authors.
|
* Copyright 2011-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2011-2021 the original author or authors.
|
* Copyright 2011-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2015-2021 the original author or authors.
|
* Copyright 2015-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2015-2021 the original author or authors.
|
* Copyright 2015-2020 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user