Compare commits

..

187 Commits

Author SHA1 Message Date
Mark Paluch
5b502a095f Update reference docs to use correct MongoClient.
Closes #3666
2021-06-22 14:36:49 +02:00
larsw
7552329598 Add closing quote to GeoJson javadoc.
Closes #3677
2021-06-21 13:58:56 +02:00
Mark Paluch
fa4f8bfe9f Updated changelog.
See #3629
2021-05-14 12:36:36 +02:00
Mark Paluch
58fde292d5 Updated changelog.
See #3628
2021-05-14 12:06:42 +02:00
Greg L. Turnquist
e71f8b34be Authenticate with artifactory.
See #3616.
2021-04-22 15:04:24 -05:00
Mark Paluch
152d84a200 Updated changelog.
See #3616
2021-04-14 14:39:59 +02:00
Mark Paluch
ddf77d55ff Updated changelog.
See #3617
2021-04-14 11:43:33 +02:00
Mark Paluch
2acf1bc5d4 After release cleanups.
See #3597
2021-04-14 11:16:05 +02:00
Mark Paluch
26f230036a Prepare next development iteration.
See #3597
2021-04-14 11:16:01 +02:00
Mark Paluch
3ee696dab2 Release version 3.0.9 (Neumann SR9).
See #3597
2021-04-14 11:04:45 +02:00
Mark Paluch
7ee12e9637 Prepare 3.0.9 (Neumann SR9).
See #3597
2021-04-14 11:04:07 +02:00
Mark Paluch
414d716c07 Updated changelog.
See #3597
2021-04-14 11:03:59 +02:00
Mark Paluch
5f9e25cd8a Polishing.
Fix nullability annotations for isEqual(…) parameters. Fix generics. Reformat code.

Add tests.

See #3414
Original pull request: #3615.
2021-04-13 09:44:41 +02:00
Clement Petit
caa2dd4e85 Handle nested Pattern and Document in Criteria.equals(…).
Closes #3414
Original pull request: #3615.
2021-04-13 09:44:41 +02:00
Mark Paluch
28fc1e4823 Polishing.
Use ObjectUtils for empty check.

See #3623
Original pull request: #3625.
2021-04-13 09:09:49 +02:00
Christoph Strobl
d62639d11c Fix NPE in declarative aggregation execution.
This commit fixes an issue where using a simple return type leads to NPE when the actual aggregation result does not contain any values.

Closes: #3623
Original pull request: #3625.
2021-04-13 09:09:49 +02:00
Mark Paluch
b13e47d8ac Updated changelog.
See #3598
2021-03-31 18:30:47 +02:00
Mark Paluch
3743ca56df Updated changelog.
See #3595
2021-03-31 17:26:07 +02:00
Clément Petit
0f974130d1 Return saved entity reference instead of original reference.
Make SimpleReactiveMongoRepository#saveAll(Publisher<S>) return the saved entity references instead of the original references.

Closes #3609
Original pull request: #3611.
2021-03-29 11:03:44 +02:00
Mark Paluch
020da42800 Updated changelog.
See #3558
2021-03-17 11:31:31 +01:00
Mark Paluch
4307b4cd91 Updated changelog.
See #3561
2021-03-17 11:03:42 +01:00
Mark Paluch
af874b635c After release cleanups.
See #3556
2021-03-17 10:33:57 +01:00
Mark Paluch
017e01810d Prepare next development iteration.
See #3556
2021-03-17 10:33:55 +01:00
Mark Paluch
05b46779cb Release version 3.0.8 (Neumann SR8).
See #3556
2021-03-17 10:21:33 +01:00
Mark Paluch
ba56d247c9 Prepare 3.0.8 (Neumann SR8).
See #3556
2021-03-17 10:21:08 +01:00
Mark Paluch
4484dac574 Updated changelog.
See #3556
2021-03-17 10:21:02 +01:00
Mark Paluch
af4b1788fc Polishing.
Move hasValue(…) from DocumentAccessor to BsonUtils. Fix typo in tests.

See: #3590
Original pull request: #3591.
2021-03-15 14:07:35 +01:00
Christoph Strobl
af40f15a36 Fix ShardKey lookup for nested paths.
This commit fixes the lookup of shard key values for nested paths using the dot (.) notation.

Closes: #3590
Original pull request: #3591.
2021-03-15 14:07:34 +01:00
Christoph Strobl
193b7de2d9 Upgrade MongoDB drivers to 4.0.6
Closes #3588
2021-03-15 09:24:19 +01:00
Christoph Strobl
f5204e859f Preserve class keyword as Map key during update mapping.
This commit makes sure to skip the class property ob Object when mapping maps and their keys inside an Update.

Closes #3566
Original pull request: #3577.
2021-03-02 11:37:43 +01:00
Mark Paluch
16818324d8 Polishing.
Reformat code. Reduce method visibility in JUnit 5 tests. Add Nullable annotations to address warnings.

See #3568
Original pull request: #3569.
2021-03-02 11:30:31 +01:00
Brice Vandeputte
a9269c0086 Translate MongoSocketException subclasses to DataAccessResourceFailureException.
Closes #3568
Original pull request: #3569.
2021-03-02 11:30:30 +01:00
Christoph Strobl
d3624b9af4 Remove duplicate JSON Schema section from reference documentation.
Closes: #3573
Original pull request: #3574.
2021-03-01 14:42:38 +01:00
Mark Paluch
3711ed5b50 Polishing.
Simplify assertions.

See #3552.
Original pull request: #3565.
2021-02-22 10:01:49 +01:00
Christoph Strobl
c20feabada Preserve numeric keys that exceed Long range when mapping Updates.
This commit makes sure we preserve map keys no matter what.

Closes #3552.
Original pull request: #3565.
2021-02-22 10:01:48 +01:00
Mark Paluch
f93e40fdee Polishing.
Reformat code. Add since tags.

See #3395
Original pull request: #3554.
2021-02-18 15:09:27 +01:00
Christoph Strobl
dca508f3dc Fix case insensitive derived in queries on String properties.
We now consider the IgnoreCase part of a derived query when used along with In. Strings will be quoted to avoid malicious strings from being handed over to the server as a regular expression to evaluate.

See #3395
Original pull request: #3554.
2021-02-18 15:09:26 +01:00
Christoph Strobl
742448a281 Updated changelog.
See #3560
2021-02-18 11:37:46 +01:00
Christoph Strobl
1a4749e97c Updated changelog.
See #3557
2021-02-18 11:18:29 +01:00
Christoph Strobl
a3cbe829b2 Updated changelog.
See #3537
2021-02-17 14:20:38 +01:00
Christoph Strobl
4ca6f29666 Updated changelog.
See #3536
2021-02-17 13:49:19 +01:00
Christoph Strobl
df65644d59 After release cleanups.
See #3520
2021-02-17 11:32:50 +01:00
Christoph Strobl
05a169c858 Prepare next development iteration.
See #3520
2021-02-17 11:32:48 +01:00
Christoph Strobl
e49119038d Release version 3.0.7 (Neumann SR7).
See #3520
2021-02-17 11:07:42 +01:00
Christoph Strobl
f2df84e8c4 Prepare 3.0.7 (Neumann SR7).
See #3520
2021-02-17 11:07:10 +01:00
Christoph Strobl
1504fd0529 Updated changelog.
See #3520
2021-02-17 11:07:02 +01:00
Christoph Strobl
f63610c925 Updated changelog.
See #3519
2021-02-17 10:58:22 +01:00
Christoph Strobl
06eb52cf13 Updated reference documentation regarding GeoJsonModule.
Original pull request: #3539.
Closes #3517
2021-02-02 14:50:59 +01:00
Christoph Strobl
c9a4a8a370 Fix Criteria chaining for Criteria.alike().
This commit fixes an issue where an Example probe would not be added to the criteria chain.

Closes #3544
Original pull request: #3549.
2021-02-01 09:14:56 +01:00
Christoph Strobl
8d17ddb92c Update QBE Documentation section.
This commit adds a note explaining scenarios suitable for an UntypedExampleMatcher.

Closes: #3474
Original pull request: #3538.
2021-01-26 15:04:51 +01:00
Christoph Strobl
0e96ef2d0c Fix method names in full text query documentation.
Closes #3525
2021-01-20 08:35:43 +01:00
Christoph Strobl
4d8b965176 Updated changelog.
See #3521
2021-01-13 15:49:49 +01:00
Christoph Strobl
37bb390447 Updated changelog.
See #3477
2021-01-13 15:16:25 +01:00
Christoph Strobl
5c79e1e4ef Update issue tracker references after GitHub issues migration.
See: #3529
2021-01-12 13:57:32 +01:00
Mark Paluch
9b41d70f75 Update copyright year to 2021.
Closes #3534
2021-01-12 11:50:53 +01:00
Mark Paluch
b2e52ab28f DATAMONGO-2671 - Polishing.
Fix copyright header.

Original pull request: #897.
2021-01-11 12:16:38 +01:00
Mark Paluch
fed33444e9 DATAMONGO-2671 - Polishing.
Fix copyright header. Add since tags.

Original pull request: #897.
2021-01-11 12:16:38 +01:00
Christoph Strobl
a4ad37703f DATAMONGO-2671 - Fix dateFromParts millisecond field name.
Use millisecond instead of milliseconds field name.

Related to: https://jira.mongodb.org/browse/DOCS-10652
Original pull request: #897.
2021-01-11 12:15:27 +01:00
Greg L. Turnquist
42e95e9600 DATAMONGO-2665 - Use Docker hub credentials for all CI jobs, 2020-12-15 15:24:44 -06:00
Mark Paluch
ed894aa51a DATAMONGO-2653 - Updated changelog. 2020-12-09 16:47:44 +01:00
Mark Paluch
693ff04294 DATAMONGO-2649 - Updated changelog. 2020-12-09 15:33:25 +01:00
Mark Paluch
b018b31e20 DATAMONGO-2647 - After release cleanups. 2020-12-09 12:41:25 +01:00
Mark Paluch
bacb75d098 DATAMONGO-2647 - Prepare next development iteration. 2020-12-09 12:41:18 +01:00
Mark Paluch
ec0fe6f994 DATAMONGO-2647 - Release version 3.0.6 (Neumann SR6). 2020-12-09 11:16:20 +01:00
Mark Paluch
d3d690b908 DATAMONGO-2647 - Prepare 3.0.6 (Neumann SR6). 2020-12-09 11:15:54 +01:00
Mark Paluch
b98b5125f1 DATAMONGO-2647 - Updated changelog. 2020-12-09 11:15:51 +01:00
Mark Paluch
d68bd4b44a DATAMONGO-2646 - Updated changelog. 2020-12-09 09:59:11 +01:00
Mark Paluch
a73ae9a1a5 DATAMONGO-2663 - Document Spring Data to MongoDB compatibility.
Original Pull Request: #895
2020-12-07 14:39:41 +01:00
Mark Paluch
ac3c578e93 DATAMONGO-2661 - Polishing.
Add ticket reference.

Original pull request: #894.
2020-11-26 11:48:07 +01:00
Yoann de Martino
9872f8cb07 DATAMONGO-2661 - Handle nullable types for KPropertyPath.
Original pull request: #894.
2020-11-26 11:47:03 +01:00
Mark Paluch
1b1ab2c495 DATAMONGO-2648 - Updated changelog. 2020-11-11 12:34:41 +01:00
Christoph Strobl
6554274dde DATAMONGO-2644 - ProjectOperation no longer errors on inclusion of default _id field.
Original pull request: #890.
2020-11-10 09:41:09 +01:00
Mark Paluch
34f91acbfe DATAMONGO-2639 - Updated changelog. 2020-10-28 16:28:04 +01:00
Mark Paluch
8e7d508cfe DATAMONGO-2625 - After release cleanups. 2020-10-28 14:51:05 +01:00
Mark Paluch
04dd78cb36 DATAMONGO-2625 - Prepare next development iteration. 2020-10-28 14:51:02 +01:00
Mark Paluch
52c554cfe1 DATAMONGO-2625 - Release version 3.0.5 (Neumann SR5). 2020-10-28 14:34:40 +01:00
Mark Paluch
c1bb8c4ba5 DATAMONGO-2625 - Prepare 3.0.5 (Neumann SR5). 2020-10-28 14:34:15 +01:00
Mark Paluch
ed9a367bb8 DATAMONGO-2625 - Updated changelog. 2020-10-28 14:34:04 +01:00
Mark Paluch
b88ce46239 DATAMONGO-2624 - Updated changelog. 2020-10-28 12:15:06 +01:00
Mark Paluch
42ec94d321 DATAMONGO-2641 - Updated changelog. 2020-10-28 11:32:32 +01:00
Robin Dupret
53f35e185f DATAMONGO-2638 - Fix list item rendering in reference documentation.
Original Pull Request: #885
2020-10-27 13:33:15 +01:00
LiangYong
e08bfd253c DATAMONGO-2638 - Fix aggregation input parameter syntax in reference documentation.
Original Pull Request: #881
2020-10-27 13:33:11 +01:00
Mark Paluch
caaafa275d DATAMONGO-2643 - Adopt to AssertJ API changes. 2020-10-26 10:59:30 +01:00
Christoph Strobl
1f082abc7f DATAMONGO-2626 - Updated changelog. 2020-10-14 14:51:55 +02:00
Mark Paluch
df77fcc19d DATAMONGO-2616 - Polishing.
Reformat code. Merge if-statements.

Original pull request: #889.
2020-10-07 11:35:57 +02:00
Christoph Strobl
007b965673 DATAMONGO-2616 - Short circuit id value assignment in MongoConverter.
Original pull request: #889.
2020-10-07 11:35:57 +02:00
Christoph Strobl
1b9680cece DATAMONGO-2633 - Fix json parsing of nested arrays in ParameterBindingDocumentCodec.
Original pull request: #888.
2020-10-05 15:35:07 +02:00
Mark Paluch
13f1d21919 DATAMONGO-2608 - Updated changelog. 2020-09-16 14:12:10 +02:00
Mark Paluch
4c10bf30bc DATAMONGO-2609 - After release cleanups. 2020-09-16 12:15:45 +02:00
Mark Paluch
8f78d0e0d8 DATAMONGO-2609 - Prepare next development iteration. 2020-09-16 12:15:40 +02:00
Mark Paluch
56115a263c DATAMONGO-2609 - Release version 3.0.4 (Neumann SR4). 2020-09-16 11:43:14 +02:00
Mark Paluch
66b809318a DATAMONGO-2609 - Prepare 3.0.4 (Neumann SR4). 2020-09-16 11:42:46 +02:00
Mark Paluch
bfff60d915 DATAMONGO-2609 - Updated changelog. 2020-09-16 11:42:29 +02:00
Mark Paluch
051e973226 DATAMONGO-2593 - Updated changelog. 2020-09-16 11:20:13 +02:00
Mark Paluch
eb61629f10 DATAMONGO-2592 - Updated changelog. 2020-09-16 10:39:02 +02:00
Christoph Strobl
85783e5354 DATAMONGO-2618 - Fix visibility of ReplaceRootDocumentOperation. 2020-09-14 13:44:36 +02:00
Michal Kurcius
433b012b91 DATAMONGO-2613 - Fix single element ArrayJsonSchemaObject to document mapping.
Now toDocument calls toDocument on items correctly.

Original Pull Request: #883
2020-08-20 09:05:58 +02:00
Mark Paluch
8dca0049ca DATAMONGO-2594 - After release cleanups. 2020-08-12 13:19:58 +02:00
Mark Paluch
635f3b82be DATAMONGO-2594 - Prepare next development iteration. 2020-08-12 13:19:55 +02:00
Mark Paluch
e69c7e1134 DATAMONGO-2594 - Release version 3.0.3 (Neumann SR3). 2020-08-12 13:07:46 +02:00
Mark Paluch
1f94e74b75 DATAMONGO-2594 - Prepare 3.0.3 (Neumann SR3). 2020-08-12 13:07:20 +02:00
Mark Paluch
98858e0f5f DATAMONGO-2594 - Updated changelog. 2020-08-12 13:07:08 +02:00
Mark Paluch
90f311de51 DATAMONGO-2579 - Updated changelog. 2020-08-12 12:01:26 +02:00
Mark Paluch
7f7015fd86 DATAMONGO-2601 - Suppress results for suspended query methods returning kotlin.Unit.
We now discard results for suspended query methods if the return type is kotlin.Unit.

Related ticket: DATACMNS-1779
2020-07-31 11:43:59 +02:00
Mark Paluch
ab9c5d73a0 DATAMONGO-2599 - Eagerly consider enum types as simple types.
MongoSimpleTypes now eagerly checks if a type is a simple one to avoid PersistentEntity registration for ChronoUnit.
2020-07-30 16:24:32 +02:00
Mark Paluch
13caa162db DATAMONGO-2598 - Polishing.
Original pull request: #872.
2020-07-28 15:22:02 +02:00
Jay Bryant
d5d620d777 DATAMONGO-2598 - Wording changes.
Removed the language of oppression and violence
and replaced it with more neutral language.

Note that problematic words in the code have
to remain in the docs until the code changes.

Original pull request: #872.
2020-07-28 15:22:01 +02:00
Mark Paluch
21d50f2a72 DATAMONGO-2568 - After release cleanups. 2020-07-22 10:37:08 +02:00
Mark Paluch
4912d62be6 DATAMONGO-2568 - Prepare next development iteration. 2020-07-22 10:37:05 +02:00
Mark Paluch
2bf6f226d6 DATAMONGO-2568 - Release version 3.0.2 (Neumann SR2). 2020-07-22 10:21:08 +02:00
Mark Paluch
1a6f7e371a DATAMONGO-2568 - Prepare 3.0.2 (Neumann SR2). 2020-07-22 10:20:44 +02:00
Mark Paluch
2ef5d795ce DATAMONGO-2568 - Updated changelog. 2020-07-22 10:20:31 +02:00
Mark Paluch
e3d2f16202 DATAMONGO-2567 - Updated changelog. 2020-07-22 10:08:49 +02:00
Mark Paluch
c44232ff39 DATAMONGO-2566 - Updated changelog. 2020-07-22 09:44:34 +02:00
Mark Paluch
385e911708 DATAMONGO-2589 - Upgrade to MongoDB Driver 4.0.5. 2020-07-17 10:49:56 +02:00
Mark Paluch
171d8b2b1e DATAMONGO-2536 - Polishing.
Encapsulate skipResults in AggregationOptions. Reformat code. Add override Javadoc.

Original pull request: #876.
2020-07-16 09:42:53 +02:00
Christoph Strobl
7ac7eefad6 DATAMONGO-2536 - Add option to skip reading aggregation result.
Introduce dedicated AggregationPipeline to encapsulate pipeline stages.

Original pull request: #876.
2020-07-16 09:42:53 +02:00
Mark Paluch
7a39e94e4b DATAMONGO-2571 - Polishing.
Reduce test method visibility for JUnit 5.

Original pull request: #873.
2020-07-15 15:33:48 +02:00
Christoph Strobl
25733664b3 DATAMONGO-2571 - Fix regular expression parameter binding for String-based queries.
Original pull request: #873.
2020-07-15 15:33:48 +02:00
Mark Paluch
81da10f499 DATAMONGO-2490 - Polishing.
Remove unnecessary code. Reuse session-associated collection when logging to avoid unqualified calls to MongoDbFactory.getMongoDatabase(). Create collection before transaction in test for compatibility with older MongoDB servers.

Original pull request: #875.
2020-07-15 15:14:08 +02:00
Christoph Strobl
bde114ed19 DATAMONGO-2490 - Fix dbref fetching during ongoing transaction.
Original pull request: #875.
2020-07-15 15:14:08 +02:00
Mark Paluch
a2403f58ec DATAMONGO-2544 - Updated changelog. 2020-06-25 12:00:24 +02:00
Mark Paluch
875b8eda9f DATAMONGO-2570 - Polishing.
Add assertions. Use method references where possible.

Original pull request: #871.
2020-06-22 10:40:04 +02:00
Mehran Behnam
fc0a021937 DATAMONGO-2570 - Change type of count variable to primitive.
Avoiding unintentional unboxing.

Original pull request: #871.
2020-06-22 10:40:04 +02:00
Mark Paluch
a6aa174ff5 DATAMONGO-2572 - Remove usage of Oppressive Language.
Replaced blacklist with denylist and introduce meta keyword SECONDARY_READS as we no longer use MongoDB API with the initial replication concept.

Original Pull Request: #870
2020-06-17 13:32:40 +02:00
Mark Paluch
8b36617752 DATAMONGO-2543 - After release cleanups. 2020-06-10 14:29:28 +02:00
Mark Paluch
56e8799c22 DATAMONGO-2543 - Prepare next development iteration. 2020-06-10 14:29:25 +02:00
Mark Paluch
88e60070d6 DATAMONGO-2543 - Release version 3.0.1 (Neumann SR1). 2020-06-10 14:02:26 +02:00
Mark Paluch
6c7039580f DATAMONGO-2543 - Prepare 3.0.1 (Neumann SR1). 2020-06-10 14:01:58 +02:00
Mark Paluch
fba003f215 DATAMONGO-2543 - Updated changelog. 2020-06-10 14:01:47 +02:00
Mark Paluch
1a3239554c DATAMONGO-2533 - Updated changelog. 2020-06-10 12:30:00 +02:00
Mark Paluch
37b541931d DATAMONGO-2532 - Updated changelog. 2020-06-10 11:48:56 +02:00
Mark Paluch
9038280f68 DATAMONGO-2565 - Polishing.
Add unit test to verify behavior. Cleanup code.

Original pull request: #869.
2020-06-10 10:15:12 +02:00
BraveLeeLee
75935a2bdb DATAMONGO-2565 - Evaluate correct expression when obtaining collation from MongoPersistentEntity.
Original pull request: #869.
2020-06-10 10:14:34 +02:00
Mark Paluch
d9ca3d7eb3 DATAMONGO-2562 - Polishing.
Fix typo in exception message.
2020-06-09 11:18:33 +02:00
Mark Paluch
04e77ad5ab DATAMONGO-2562 - Fix return type detection for suspended Kotlin methods.
See DATACMNS-1738 for further reference.
2020-06-09 11:18:33 +02:00
Mark Paluch
0ab39a17a7 DATAMONGO-2560 - Upgrade MongoDB drivers to 4.0.4. 2020-06-08 15:59:02 +02:00
Mark Paluch
49a6f13797 DATAMONGO-2542 - Polishing.
Fix nullable annotation.

Original pull request: #863.
2020-05-26 10:32:39 +02:00
Christoph Strobl
b0fd6f691b DATAMONGO-2542 - Shortcut PersistentPropertyPath resolution during query mapping.
By shortcutting the path resolution we avoid checking keywords like $in against a potential path expression.

Original pull request: #863.
2020-05-26 10:32:39 +02:00
Mark Paluch
b5778772d9 DATAMONGO-2545 - Polishing.
Fix warnings and typos.

Original pull request: #864.
2020-05-26 10:14:27 +02:00
Christoph Strobl
0f55fb305d DATAMONGO-2545 - Fix full Query Document binding resulting from SpEL.
We reenabled annotated queries using a SpEL expression resulting in the actual query document.

Original pull request: #864.
2020-05-26 10:14:27 +02:00
Christoph Strobl
5ae7547465 DATAMONGO-2545 - Fix regression in String query SpEL parameter binding.
We reenabled parameter binding within SpEL using query parameter placeholders ?0, ?1,... instead of their array index [0],[1],...

Original pull request: #864.
2020-05-26 10:14:27 +02:00
Christoph Strobl
cf4e04a30e DATAMONGO-2547 - Use target class ClassLoader instead of default CL when creating proxy instances.
Original pull request: #865.
2020-05-26 08:56:09 +02:00
Mark Paluch
89c1dc77d9 DATAMONGO-2553 - Fix reference documentation links.
Remove links to removed documentations sections.
2020-05-19 11:36:44 +02:00
Mark Paluch
a2c842b59b DATAMONGO-2534 - After release cleanups. 2020-05-12 12:56:12 +02:00
Mark Paluch
0cd0be9478 DATAMONGO-2534 - Prepare next development iteration. 2020-05-12 12:40:53 +02:00
Mark Paluch
f88d1de068 DATAMONGO-2534 - Release version 3.0 GA (Neumann). 2020-05-12 12:28:23 +02:00
Mark Paluch
62bfde2b6b DATAMONGO-2534 - Prepare 3.0 GA (Neumann). 2020-05-12 12:27:59 +02:00
Mark Paluch
93a27f80a3 DATAMONGO-2534 - Updated changelog. 2020-05-12 12:27:47 +02:00
Christoph Strobl
c2b0090ff1 DATAMONGO-2541 - Upgrade to MongoDB 4.0.3 Drivers. 2020-05-11 17:00:39 +02:00
Florian Bernard
0345abb5f8 DATAMONGO-2509 - Add missing Query constructor in reference documentation.
Original pull request: #846.
2020-05-06 11:52:16 +02:00
Mark Paluch
35196e3129 DATAMONGO-2509 - Polishing.
Fix typos, improve wording. Reworks documentation specific to MongoDB 3 and 4.

Original pull request: #853.
2020-05-06 11:46:29 +02:00
Christoph Strobl
37d99c4948 DATAMONGO-2509 - Update Javadoc.
Original pull request: #853.
2020-05-06 11:21:11 +02:00
Christoph Strobl
288e04b2d3 DATAMONGO-2509 - Update Reference Documentation.
Related to: DATAMONGO-365, DATAMONGO-384, DATAMONGO-2192, DATAMONGO-2407

Original pull request: #853.
2020-05-06 11:21:02 +02:00
Greg Turnquist
689c1480bd DATAMONGO-2535 - Remove Travis CI. 2020-05-04 15:09:00 -05:00
Mark Paluch
09fbe6060e DATAMONGO-2503 - After release cleanups. 2020-04-28 15:11:43 +02:00
Mark Paluch
d5cf3dfc22 DATAMONGO-2503 - Prepare next development iteration. 2020-04-28 15:11:42 +02:00
Mark Paluch
0f987f44ef DATAMONGO-2503 - Release version 3.0 RC2 (Neumann). 2020-04-28 15:03:53 +02:00
Mark Paluch
5df22233d8 DATAMONGO-2503 - Prepare 3.0 RC2 (Neumann). 2020-04-28 15:03:33 +02:00
Mark Paluch
9751c6bc8b DATAMONGO-2503 - Updated changelog. 2020-04-28 15:03:26 +02:00
Mark Paluch
7dc509953a DATAMONGO-2500 - Updated changelog. 2020-04-28 14:46:50 +02:00
Mark Paluch
2f4f1e524d DATAMONGO-2484 - Updated changelog. 2020-04-28 11:59:01 +02:00
Christoph Strobl
26ddf9d59f DATAMONGO-2531 - Fix MongoClientSettings UUID configuration hook in MongoConfigurationSupport.
Client code overriding configureClientSettings does not automatically remove the default UUidRepresentation settings.
2020-04-27 09:30:37 +02:00
Mark Paluch
96ff4e1d14 DATAMONGO-2461 - Polishing.
Remove superfluous Test annotation as RepeatFailedTest acts as a TestTemplate so adding the Test annotation causes the test to run twice.
2020-04-24 09:03:18 +02:00
Mark Paluch
2af13c27a7 DATAMONGO-2529 - Ensure that MappingMongoConverter.read(…) is never called with null.
Previously, various methods attempted to pass a null argument as source for the converter. The API is non-null and implementations relying on these constraints were easily breakable.

We now make sure that the source is never null.
2020-04-23 14:57:52 +02:00
Mark Paluch
f4d2fc6231 DATAMONGO-2504 - Polishing.
Update equals/hashCode implementation to use the Spring Data form. Make fields final where possible. Use diamond syntax. Reorder methods. Reformat code. Extend tests.

Original pull request: #848.
2020-04-23 12:24:26 +02:00
ddebray
3ab679bcc7 DATAMONGO-2504 - Add hashCode and equals to TextCriteria and Term.
Original pull request: #848.
2020-04-23 12:24:10 +02:00
Mark Paluch
318d552797 DATAMONGO-2505 - Polishing.
Simplify operators. Remove Lombok usage from newly introduced code. Update reference documentation. Reformat code.

Original pull request: #854.
2020-04-23 12:02:46 +02:00
Mathieu Ouellet
8cfbd39c7e DATAMONGO-2505 - Deferred Database retrieval from ReactiveMongoDatabaseFactory.
Change ReactiveMongoDatabaseFactory#getMongoDatabase() methods return Mono to enable access to the subscriber context.

Original pull request: #854.
2020-04-23 12:02:15 +02:00
Christoph Strobl
3a14af5485 DATAMONGO-2513 - Fix Eq aggregation operator comparing collection values.
Original pull request: #855.
2020-04-22 11:46:49 +02:00
Mark Paluch
00034d899a DATAMONGO-2516 - Polishing.
Reflect nullability change in TextScore Javadoc. Update documentation.

Original pull request: #856.
2020-04-22 11:12:50 +02:00
Christoph Strobl
fba6d7d8be DATAMONGO-2516 - Assert compatibility with MongoDB 4.4-rc0.
Fixes:
- Fields list must not contain text search score property when no $text criteria present.
- Sort must not be an empty document when running map reduce.
- Timeout in tests creating indexes.

Changes:
- score property might now be null when not having a $text criteria present. Was zero before.

Original pull request: #856.
2020-04-22 11:12:29 +02:00
Mark Paluch
95c4707902 DATAMONGO-2523 - Polishing.
Reformat code.

Original pull request: #859.
2020-04-22 10:14:50 +02:00
Christoph Strobl
32f3e60c9f DATAMONGO-2523 - Fix Json binding of SpEL expressions in arrays.
The closing bracket must not have a leading whitespace.

Original pull request: #859.
2020-04-22 10:08:57 +02:00
Mark Paluch
b57e571033 DATAMONGO-2517 - Polishing.
Reformat code.

Original pull request: #857.
2020-04-21 16:02:09 +02:00
Christoph Strobl
6604c507dd DATAMONGO-2517 - Fix invalid entity creation for text queries.
Fix a glitch in the MappingMongoConverter that uses the single String argument constructor (since it matches in type and parameter count to the given input string) to falsely instantiate an Entity when it should not.

Original pull request: #857.
2020-04-21 16:02:04 +02:00
Christoph Strobl
e1df28797a DATAMONGO-2507 - Polishing.
Add 'matching' default method also to imperative variant (ExecutableFindOperation), fix & add tests using 'distinct'.
Update Javadoc and rename input arg 'criteriaDefinition' to 'criteria'.

Original Pull Request: #852
2020-04-14 10:22:01 +02:00
Juergen Zimmermann
c6630aa279 DATAMONGO-2507 - Add default method matching(CriteriaDefinition) to ReactiveFindOperation.DistinctWithQuery.
Original Pull Request: #852
2020-04-14 09:51:23 +02:00
Greg Turnquist
bf921cdbd7 DATAMONGO-2510 - Use JDK 14 for Java.NEXT CI testing. 2020-04-09 14:29:16 -05:00
Christoph Strobl
a1b4e6df59 DATAMONGO-2508 - Upgrade to MongoDB 4.0.2 Drivers. 2020-04-08 11:38:19 +02:00
Christoph Strobl
4b3312998a DATAMONGO-2506 - Provide meaningful error message when using unsupported return type in repository aggregation method.
We improved the error message for unsupported return types instead of running into an IllegalArgumentException for unique results.

Original pull request: #851.
2020-04-07 14:58:38 +02:00
Mark Paluch
c5501db577 DATAMONGO-2502 - Polishing.
Extend tests. Fix generics. Consistently use compiled patterns for positional placeholder removal.

Original pull request: #847.
2020-04-07 14:10:20 +02:00
Christoph Strobl
936a0d35f7 DATAMONGO-2502 - Fix nested array path mapping for updates.
Original pull request: #847.
2020-04-07 14:10:09 +02:00
Christoph Strobl
5dd91d0b6d DATAMONGO-1677 - Polishing.
Switch tests to JUnit Jupiter.

Original Pull Request: #849
2020-04-06 08:51:30 +02:00
Jens Schauder
28510de6c8 DATAMONGO-1677 - Adds a test to confirm a query with more than 10 arguments works just fine.
Original Pull Request: #849
2020-04-06 08:50:56 +02:00
Mark Paluch
4bbf4cd5cf DATAMONGO-2492 - After release cleanups. 2020-03-31 15:08:05 +02:00
Mark Paluch
90bd3f0f18 DATAMONGO-2492 - Prepare next development iteration. 2020-03-31 15:08:04 +02:00
985 changed files with 6252 additions and 3846 deletions

View File

@@ -1,40 +0,0 @@
language: java
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
jdk:
- openjdk13
- openjdk-ea
matrix:
allow_failures:
- jdk: openjdk-ea
env:
matrix:
- MONGO_VERSION=4.2.0
- MONGO_VERSION=4.0.14
- MONGO_VERSION=3.6.16
global:
- PROFILE=ci
sudo: false
cache:
directories:
- $HOME/.m2
- downloads
install: true
script:
- "./mvnw clean dependency:list test -Pjava11 -Dsort -U"

183
Jenkinsfile vendored
View File

@@ -3,7 +3,7 @@ pipeline {
triggers { triggers {
pollSCM 'H/10 * * * *' pollSCM 'H/10 * * * *'
upstream(upstreamProjects: "spring-data-commons/master", threshold: hudson.model.Result.SUCCESS) upstream(upstreamProjects: "spring-data-commons/2.3.x", threshold: hudson.model.Result.SUCCESS)
} }
options { options {
@@ -46,16 +46,16 @@ pipeline {
} }
} }
} }
stage('Publish JDK 13 + MongoDB 4.2') { stage('Publish JDK 14 + MongoDB 4.2') {
when { when {
changeset "ci/openjdk13-mongodb-4.2/**" changeset "ci/openjdk14-mongodb-4.2/**"
} }
agent { label 'data' } agent { label 'data' }
options { timeout(time: 30, unit: 'MINUTES') } options { timeout(time: 30, unit: 'MINUTES') }
steps { steps {
script { script {
def image = docker.build("springci/spring-data-openjdk13-with-mongodb-4.2.0", "ci/openjdk13-mongodb-4.2/") def image = docker.build("springci/spring-data-openjdk14-with-mongodb-4.2.0", "ci/openjdk14-mongodb-4.2/")
docker.withRegistry('', 'hub.docker.com-springbuildmaster') { docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
image.push() image.push()
} }
@@ -68,94 +68,110 @@ pipeline {
stage("test: baseline (jdk8)") { stage("test: baseline (jdk8)") {
when { when {
anyOf { anyOf {
branch 'master' branch '3.0.x'
not { triggeredBy 'UpstreamCause' } not { triggeredBy 'UpstreamCause' }
} }
} }
agent { agent {
docker { label 'data'
image 'springci/spring-data-openjdk8-with-mongodb-4.2.0:latest'
label 'data'
args '-v $HOME:/tmp/jenkins-home'
}
} }
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 ?' script {
sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log' docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
sh 'mongod --setParameter transactionLifetimeLimitSeconds=90 --setParameter maxTransactionLockRequestTimeoutMillis=10000 --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &' docker.image('springci/spring-data-openjdk8-with-mongodb-4.2.0:latest').inside('-v $HOME:/tmp/jenkins-home') {
sh 'sleep 10' sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"' sh 'mongod --setParameter transactionLifetimeLimitSeconds=90 --setParameter maxTransactionLockRequestTimeoutMillis=10000 --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &'
sh 'sleep 15' sh 'sleep 10'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list test -Duser.name=jenkins -Dsort -U -B' sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
sh 'sleep 15'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean dependency:list test -Duser.name=jenkins -Dsort -U -B'
}
}
}
} }
} }
stage("Test other configurations") { stage("Test other configurations") {
when { when {
anyOf { anyOf {
branch 'master' branch '3.0.x'
not { triggeredBy 'UpstreamCause' } not { triggeredBy 'UpstreamCause' }
} }
} }
parallel { parallel {
stage("test: mongodb 4.0 (jdk8)") { stage("test: mongodb 4.0 (jdk8)") {
agent { agent {
docker { label 'data'
image 'springci/spring-data-openjdk8-with-mongodb-4.0:latest'
label 'data'
args '-v $HOME:/tmp/jenkins-home'
}
} }
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 ?' script {
sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log' docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
sh 'mongod --setParameter transactionLifetimeLimitSeconds=90 --setParameter maxTransactionLockRequestTimeoutMillis=10000 --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &' docker.image('springci/spring-data-openjdk8-with-mongodb-4.0:latest').inside('-v $HOME:/tmp/jenkins-home') {
sh 'sleep 10' sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"' sh 'mongod --setParameter transactionLifetimeLimitSeconds=90 --setParameter maxTransactionLockRequestTimeoutMillis=10000 --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &'
sh 'sleep 15' sh 'sleep 10'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list test -Duser.name=jenkins -Dsort -U -B' sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
sh 'sleep 15'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean dependency:list test -Duser.name=jenkins -Dsort -U -B'
}
}
}
} }
} }
stage("test: mongodb 4.2 (jdk8)") { stage("test: mongodb 4.2 (jdk8)") {
agent { agent {
docker { label 'data'
image 'springci/spring-data-openjdk8-with-mongodb-4.2.0:latest'
label 'data'
args '-v $HOME:/tmp/jenkins-home'
}
} }
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 ?' script {
sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log' docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
sh 'mongod --setParameter transactionLifetimeLimitSeconds=90 --setParameter maxTransactionLockRequestTimeoutMillis=10000 --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &' docker.image('springci/spring-data-openjdk8-with-mongodb-4.2.0:latest').inside('-v $HOME:/tmp/jenkins-home') {
sh 'sleep 10' sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"' sh 'mongod --setParameter transactionLifetimeLimitSeconds=90 --setParameter maxTransactionLockRequestTimeoutMillis=10000 --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &'
sh 'sleep 15' sh 'sleep 10'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list test -Duser.name=jenkins -Dsort -U -B' sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
sh 'sleep 15'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml clean dependency:list test -Duser.name=jenkins -Dsort -U -B'
}
}
}
} }
} }
stage("test: baseline (jdk13)") { stage("test: baseline (jdk14)") {
agent { agent {
docker { label 'data'
image 'springci/spring-data-openjdk13-with-mongodb-4.2.0:latest'
label 'data'
args '-v $HOME:/tmp/jenkins-home'
}
} }
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 ?' script {
sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log' docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
sh 'mongod --setParameter transactionLifetimeLimitSeconds=90 --setParameter maxTransactionLockRequestTimeoutMillis=10000 --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &' docker.image('springci/spring-data-openjdk15-with-mongodb-4.2.0:latest').inside('-v $HOME:/tmp/jenkins-home') {
sh 'sleep 10' sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log'
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"' sh 'mongod --setParameter transactionLifetimeLimitSeconds=90 --setParameter maxTransactionLockRequestTimeoutMillis=10000 --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &'
sh 'sleep 15' sh 'sleep 10'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pjava11 clean dependency:list test -Duser.name=jenkins -Dsort -U -B' sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
sh 'sleep 15'
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pjava11 clean dependency:list test -Duser.name=jenkins -Dsort -U -B'
}
}
}
} }
} }
} }
@@ -164,16 +180,12 @@ pipeline {
stage('Release to artifactory') { stage('Release to artifactory') {
when { when {
anyOf { anyOf {
branch 'master' branch '3.0.x'
not { triggeredBy 'UpstreamCause' } not { triggeredBy 'UpstreamCause' }
} }
} }
agent { agent {
docker { label 'data'
image 'adoptopenjdk/openjdk8:latest'
label 'data'
args '-v $HOME:/tmp/jenkins-home'
}
} }
options { timeout(time: 20, unit: 'MINUTES') } options { timeout(time: 20, unit: 'MINUTES') }
@@ -182,28 +194,29 @@ pipeline {
} }
steps { steps {
sh 'rm -rf ?' script {
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' + docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
'-Dartifactory.server=https://repo.spring.io ' + docker.image('adoptopenjdk/openjdk8:latest').inside('-v $HOME:/tmp/jenkins-home') {
"-Dartifactory.username=${ARTIFACTORY_USR} " + sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,artifactory ' +
"-Dartifactory.password=${ARTIFACTORY_PSW} " + '-Dartifactory.server=https://repo.spring.io ' +
"-Dartifactory.staging-repository=libs-snapshot-local " + "-Dartifactory.username=${ARTIFACTORY_USR} " +
"-Dartifactory.build-name=spring-data-mongodb " + "-Dartifactory.password=${ARTIFACTORY_PSW} " +
"-Dartifactory.build-number=${BUILD_NUMBER} " + "-Dartifactory.staging-repository=libs-snapshot-local " +
'-Dmaven.test.skip=true clean deploy -U -B' "-Dartifactory.build-name=spring-data-mongodb " +
"-Dartifactory.build-number=${BUILD_NUMBER} " +
'-Dmaven.test.skip=true clean deploy -U -B'
}
}
}
} }
} }
stage('Publish documentation') { stage('Publish documentation') {
when { when {
branch 'master' branch '3.0.x'
} }
agent { agent {
docker { label 'data'
image 'adoptopenjdk/openjdk8:latest'
label 'data'
args '-v $HOME:/tmp/jenkins-home'
}
} }
options { timeout(time: 20, unit: 'MINUTES') } options { timeout(time: 20, unit: 'MINUTES') }
@@ -212,12 +225,18 @@ pipeline {
} }
steps { steps {
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,distribute ' + script {
'-Dartifactory.server=https://repo.spring.io ' + docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
"-Dartifactory.username=${ARTIFACTORY_USR} " + docker.image('adoptopenjdk/openjdk8:latest').inside('-v $HOME:/tmp/jenkins-home') {
"-Dartifactory.password=${ARTIFACTORY_PSW} " + sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,distribute ' +
"-Dartifactory.distribution-repository=temp-private-local " + '-Dartifactory.server=https://repo.spring.io ' +
'-Dmaven.test.skip=true clean deploy -U -B' "-Dartifactory.username=${ARTIFACTORY_USR} " +
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
"-Dartifactory.distribution-repository=temp-private-local " +
'-Dmaven.test.skip=true clean deploy -U -B'
}
}
}
} }
} }
} }

202
LICENSE.txt Normal file
View File

@@ -0,0 +1,202 @@
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.

View File

@@ -52,11 +52,6 @@ public class MyService {
@EnableMongoRepositories @EnableMongoRepositories
class ApplicationConfig extends AbstractMongoClientConfiguration { class ApplicationConfig extends AbstractMongoClientConfiguration {
@Override
public MongoClient mongoClient() {
return MongoClients.create();
}
@Override @Override
protected String getDatabaseName() { protected String getDatabaseName() {
return "springdata"; return "springdata";
@@ -242,18 +237,17 @@ 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://jira.spring.io/browse/DATAMONGO[jira.spring.io/browse/DATAMONGO]. * Report bugs with Spring Data MongoDB at https://github.com/spring-projects/spring-data-mongodb/issues[github.com/spring-projects/spring-data-mongodb/issues].
== Reporting Issues == Reporting Issues
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: Spring Data uses Github as issue tracking system to record bugs and feature requests.
If you want to raise an issue, please follow the recommendations below:
* Before you log a bug, please search the * 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.
https://jira.spring.io/browse/DATAMONGO[issue tracker] to see if someone has already reported the problem. * If the issue does not already exist, https://github.com/spring-projects/spring-data-mongodb/issues/new[create a new issue].
* If the issue doesnt already exist, https://jira.spring.io/browse/DATAMONGO[create a new issue]. * 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.
* 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 https://guides.github.com/features/mastering-markdown/[Markdown] code fences +++```+++.
* 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

View File

@@ -1,4 +1,4 @@
FROM adoptopenjdk/openjdk13:latest FROM adoptopenjdk/openjdk14:latest
ENV TZ=Etc/UTC ENV TZ=Etc/UTC
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive

13
pom.xml
View File

@@ -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>3.0.0.RC1</version> <version>3.0.10.BUILD-SNAPSHOT</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.3.0.RC1</version> <version>2.3.10.BUILD-SNAPSHOT</version>
</parent> </parent>
<modules> <modules>
@@ -26,8 +26,8 @@
<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.3.0.RC1</springdata.commons> <springdata.commons>2.3.10.BUILD-SNAPSHOT</springdata.commons>
<mongo>4.0.1</mongo> <mongo>4.0.6</mongo>
<mongo.reactivestreams>${mongo}</mongo.reactivestreams> <mongo.reactivestreams>${mongo}</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-milestone</id> <id>spring-libs-snapshot</id>
<url>https://repo.spring.io/libs-milestone</url> <url>https://repo.spring.io/libs-snapshot</url>
</repository> </repository>
<repository> <repository>
<id>sonatype-libs-snapshot</id> <id>sonatype-libs-snapshot</id>
@@ -158,7 +158,6 @@
<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 Normal file
View File

@@ -0,0 +1,29 @@
<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>

View File

@@ -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>3.0.0.RC1</version> <version>3.0.10.BUILD-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2017-2020 the original author or authors. * Copyright 2017-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2017-2020 the original author or authors. * Copyright 2017-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2017-2020 the original author or authors. * Copyright 2017-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2017-2020 the original author or authors. * Copyright 2017-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2017-2020 the original author or authors. * Copyright 2017-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2017-2020 the original author or authors. * Copyright 2017-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2017-2020 the original author or authors. * Copyright 2017-2021 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.

View File

@@ -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>3.0.0.RC1</version> <version>3.0.10.BUILD-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@@ -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>3.0.0.RC1</version> <version>3.0.10.BUILD-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2015-2020 the original author or authors. * Copyright 2015-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2018-2020 the original author or authors. * Copyright 2018-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2017-2020 the original author or authors. * Copyright 2017-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2020 the original author or authors. * Copyright 2010-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2013-2020 the original author or authors. * Copyright 2013-2021 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,8 +25,10 @@ public class LazyLoadingException extends UncategorizedDataAccessException {
private static final long serialVersionUID = -7089224903873220037L; private static final long serialVersionUID = -7089224903873220037L;
/** /**
* @param msg * Constructor for LazyLoadingException.
* @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);

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2011-2020 the original author or authors. * Copyright 2011-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2011-2019 the original author or authors. * Copyright 2011-2021 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.
@@ -45,7 +45,7 @@ public interface MongoDatabaseFactory extends CodecRegistryProvider, MongoSessio
/** /**
* Obtain a {@link MongoDatabase} instance to access the database with the given name. * Obtain a {@link MongoDatabase} instance to access the database with the given name.
* *
* @param dbName * @param dbName must not be {@literal null}.
* @return never {@literal null}. * @return never {@literal null}.
* @throws DataAccessException * @throws DataAccessException
*/ */

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2018-2020 the original author or authors. * Copyright 2018-2021 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 MongoDatabaseFactory} to get the {@link MongoDatabase} from. * @param factory the {@link MongoDatabaseFactory} 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(String dbName, MongoDatabaseFactory factory) { public static MongoDatabase getDatabase(@Nullable String dbName, MongoDatabaseFactory factory) {
return doGetMongoDatabase(dbName, factory, SessionSynchronization.ON_ACTUAL_TRANSACTION); return doGetMongoDatabase(dbName, factory, SessionSynchronization.ON_ACTUAL_TRANSACTION);
} }
@@ -94,7 +94,7 @@ public class MongoDatabaseUtils {
* @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(String dbName, MongoDatabaseFactory factory, public static MongoDatabase getDatabase(@Nullable String dbName, MongoDatabaseFactory factory,
SessionSynchronization sessionSynchronization) { SessionSynchronization sessionSynchronization) {
return doGetMongoDatabase(dbName, factory, sessionSynchronization); return doGetMongoDatabase(dbName, factory, sessionSynchronization);
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2011-2020 the original author or authors. * Copyright 2011-2021 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.
@@ -33,7 +33,7 @@ public interface MongoDbFactory extends MongoDatabaseFactory {
/** /**
* Creates a default {@link MongoDatabase} instance. * Creates a default {@link MongoDatabase} instance.
* *
* @return * @return never {@literal null}.
* @throws DataAccessException * @throws DataAccessException
* @deprecated since 3.0. Use {@link #getMongoDatabase()} instead. * @deprecated since 3.0. Use {@link #getMongoDatabase()} instead.
*/ */
@@ -46,7 +46,7 @@ public interface MongoDbFactory extends MongoDatabaseFactory {
* Obtain a {@link MongoDatabase} instance to access the database with the given name. * Obtain 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 * @return never {@literal null}.
* @throws DataAccessException * @throws DataAccessException
* @deprecated since 3.0. Use {@link #getMongoDatabase(String)} instead. * @deprecated since 3.0. Use {@link #getMongoDatabase(String)} instead.
*/ */

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2018-2020 the original author or authors. * Copyright 2018-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2018-2020 the original author or authors. * Copyright 2018-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2018-2020 the original author or authors. * Copyright 2018-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2018-2020 the original author or authors. * Copyright 2018-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2016-2020 the original author or authors. * Copyright 2016-2021 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.
@@ -31,6 +31,7 @@ import com.mongodb.reactivestreams.client.MongoDatabase;
* *
* @author Mark Paluch * @author Mark Paluch
* @author Christoph Strobl * @author Christoph Strobl
* @author Mathieu Ouellet
* @since 2.0 * @since 2.0
*/ */
public interface ReactiveMongoDatabaseFactory extends CodecRegistryProvider { public interface ReactiveMongoDatabaseFactory extends CodecRegistryProvider {
@@ -38,19 +39,19 @@ public interface ReactiveMongoDatabaseFactory extends CodecRegistryProvider {
/** /**
* Creates a default {@link MongoDatabase} instance. * Creates a default {@link MongoDatabase} instance.
* *
* @return * @return never {@literal null}.
* @throws DataAccessException * @throws DataAccessException
*/ */
MongoDatabase getMongoDatabase() throws DataAccessException; Mono<MongoDatabase> getMongoDatabase() throws DataAccessException;
/** /**
* Obtain a {@link MongoDatabase} instance to access the database with the given name. * Obtain 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 * @return never {@literal null}.
* @throws DataAccessException * @throws DataAccessException
*/ */
MongoDatabase getMongoDatabase(String dbName) throws DataAccessException; Mono<MongoDatabase> getMongoDatabase(String dbName) throws DataAccessException;
/** /**
* Exposes a shared {@link MongoExceptionTranslator}. * Exposes a shared {@link MongoExceptionTranslator}.
@@ -64,10 +65,7 @@ public interface ReactiveMongoDatabaseFactory extends CodecRegistryProvider {
* *
* @return never {@literal null}. * @return never {@literal null}.
*/ */
@Override CodecRegistry getCodecRegistry();
default CodecRegistry getCodecRegistry() {
return getMongoDatabase().getCodecRegistry();
}
/** /**
* Obtain a {@link Mono} emitting a {@link ClientSession} for given {@link ClientSessionOptions options}. * Obtain a {@link Mono} emitting a {@link ClientSession} for given {@link ClientSessionOptions options}.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2019-2020 the original author or authors. * Copyright 2019-2021 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.
@@ -41,6 +41,7 @@ import com.mongodb.reactivestreams.client.MongoDatabase;
* *
* @author Mark Paluch * @author Mark Paluch
* @author Christoph Strobl * @author Christoph Strobl
* @author Mathieu Ouellet
* @since 2.2 * @since 2.2
*/ */
public class ReactiveMongoDatabaseUtils { public class ReactiveMongoDatabaseUtils {
@@ -142,14 +143,13 @@ public class ReactiveMongoDatabaseUtils {
.flatMap(synchronizationManager -> { .flatMap(synchronizationManager -> {
return doGetSession(synchronizationManager, factory, sessionSynchronization) // return doGetSession(synchronizationManager, factory, sessionSynchronization) //
.map(it -> getMongoDatabaseOrDefault(dbName, factory.withSession(it))); .flatMap(it -> getMongoDatabaseOrDefault(dbName, factory.withSession(it)));
}) }) //
.onErrorResume(NoTransactionException.class, .onErrorResume(NoTransactionException.class, e -> getMongoDatabaseOrDefault(dbName, factory))
e -> Mono.fromSupplier(() -> getMongoDatabaseOrDefault(dbName, factory))) .switchIfEmpty(getMongoDatabaseOrDefault(dbName, factory));
.defaultIfEmpty(getMongoDatabaseOrDefault(dbName, factory));
} }
private static MongoDatabase getMongoDatabaseOrDefault(@Nullable String dbName, private static Mono<MongoDatabase> getMongoDatabaseOrDefault(@Nullable String dbName,
ReactiveMongoDatabaseFactory factory) { ReactiveMongoDatabaseFactory factory) {
return StringUtils.hasText(dbName) ? factory.getMongoDatabase(dbName) : factory.getMongoDatabase(); return StringUtils.hasText(dbName) ? factory.getMongoDatabase(dbName) : factory.getMongoDatabase();
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2019-2020 the original author or authors. * Copyright 2019-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2019-2020 the original author or authors. * Copyright 2019-2021 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()
*/ */

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2018-2020 the original author or authors. * Copyright 2018-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2018-2020 the original author or authors. * Copyright 2018-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2020 the original author or authors. * Copyright 2020-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2020 the original author or authors. * Copyright 2010-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2018-2020 the original author or authors. * Copyright 2018-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2016-2020 the original author or authors. * Copyright 2016-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2011-2020 the original author or authors. * Copyright 2011-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2019 the original author or authors. * Copyright 2019-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2013-2020 the original author or authors. * Copyright 2013-2021 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 * @return empty {@link String} by default.
*/ */
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 * @return {@literal true} by default.
*/ */
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 * @return {@literal true} by default.
*/ */
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 * @return empty {@link String} by default.
*/ */
String dateTimeProviderRef() default ""; String dateTimeProviderRef() default "";
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2015-2020 the original author or authors. * Copyright 2015-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2013-2020 the original author or authors. * Copyright 2013-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2011-2020 the original author or authors. * Copyright 2011-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2020 the original author or authors. * Copyright 2012-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2013-2020 the original author or authors. * Copyright 2013-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2015-2020 the original author or authors. * Copyright 2015-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2016-2020 the original author or authors. * Copyright 2016-2021 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 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 CustomConversions} will be registered with the
* {@link org.springframework.data.mongodb.core.convert.MappingMongoConverter} and {@link #mongoMappingContext()}. * {@link org.springframework.data.mongodb.core.convert.MappingMongoConverter} and {@link MongoMappingContext}.
* Returns an empty {@link MongoCustomConversions} instance by default. * Returns an empty {@link MongoCustomConversions} instance by default.
* <p> * <p>
* <strong>NOTE:</strong> Use {@link #configureConverters(MongoConverterConfigurationAdapter)} to configure MongoDB * <strong>NOTE:</strong> Use {@link #configureConverters(MongoConverterConfigurationAdapter)} to configure MongoDB
@@ -217,6 +217,7 @@ public abstract class MongoConfigurationSupport {
protected MongoClientSettings mongoClientSettings() { protected MongoClientSettings mongoClientSettings() {
MongoClientSettings.Builder builder = MongoClientSettings.builder(); MongoClientSettings.Builder builder = MongoClientSettings.builder();
builder.uuidRepresentation(UuidRepresentation.JAVA_LEGACY);
configureClientSettings(builder); configureClientSettings(builder);
return builder.build(); return builder.build();
} }
@@ -228,6 +229,6 @@ public abstract class MongoConfigurationSupport {
* @since 3.0 * @since 3.0
*/ */
protected void configureClientSettings(MongoClientSettings.Builder builder) { protected void configureClientSettings(MongoClientSettings.Builder builder) {
builder.uuidRepresentation(UuidRepresentation.JAVA_LEGACY); // customization hook
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2015-2020 the original author or authors. * Copyright 2015-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2011-2020 the original author or authors. * Copyright 2011-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2011-2020 the original author or authors. * Copyright 2011-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2011-2020 the original author or authors. * Copyright 2011-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2011-2020 the original author or authors. * Copyright 2011-2021 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.
@@ -45,7 +45,7 @@ abstract class MongoParsingUtils {
/** /**
* Parses the {@code mongo:client-settings} sub-element. Populates the given attribute factory with the proper * Parses the {@code mongo:client-settings} sub-element. Populates the given attribute factory with the proper
* attributes. * attributes.
* *
* @param element * @param element
* @param mongoClientBuilder * @param mongoClientBuilder
* @return * @return

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2011-2020 the original author or authors. * Copyright 2011-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2019 the original author or authors. * Copyright 2019-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2015-2020 the original author or authors. * Copyright 2015-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2011-2020 the original author or authors. * Copyright 2011-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2020 the original author or authors. * Copyright 2012-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2020 the original author or authors. * Copyright 2020-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2011-2020 the original author or authors. * Copyright 2011-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2018-2020 the original author or authors. * Copyright 2018-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2015-2020 the original author or authors. * Copyright 2015-2021 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,7 +94,6 @@ 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);
@@ -105,7 +104,6 @@ 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);
@@ -115,7 +113,6 @@ 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);

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2018-2020 the original author or authors. * Copyright 2018-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2018-2020 the original author or authors. * Copyright 2018-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2020 the original author or authors. * Copyright 2010-2021 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
* @auhtor Christoph Strobl * @author Christoph Strobl
* @since 1.0 * @since 1.0
*/ */
public interface CollectionCallback<T> { public interface CollectionCallback<T> {

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2020 the original author or authors. * Copyright 2010-2021 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(int)}. * <strong>NOTE</strong> Using capped collections requires defining {@link #size(long)}.
* *
* @return new {@link CollectionOptions}. * @return new {@link CollectionOptions}.
* @since 2.0 * @since 2.0

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2019-2020 the original author or authors. * Copyright 2019-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2020 the original author or authors. * Copyright 2002-2021 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,9 +43,10 @@ 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 cursor * @param iterable must not be {@literal null}.
* @return never {@literal null}.
*/ */
FindIterable<Document> prepare(FindIterable<Document> cursor); FindIterable<Document> prepare(FindIterable<Document> iterable);
/** /**
* 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
@@ -53,7 +54,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 * @return never {@literal null}.
* @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
*/ */

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2020 the original author or authors. * Copyright 2010-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2015-2020 the original author or authors. * Copyright 2015-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2011-2020 the original author or authors. * Copyright 2011-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2016-2020 the original author or authors. * Copyright 2016-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2016-2020 the original author or authors. * Copyright 2016-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2014-2020 the original author or authors. * Copyright 2014-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2015-2020 the original author or authors. * Copyright 2015-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2020 the original author or authors. * Copyright 2010-2021 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. {@MongoException}s will be caught and translated by the calling MongoTemplate An * about exception handling. {@link 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.
* *

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2018-2020 the original author or authors. * Copyright 2018-2021 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 * @return new instance of {@link Entity}.
*/ */
@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 * @return new instance of {@link AdaptibleEntity}.
*/ */
@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,6 +108,10 @@ 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) {
@@ -138,7 +142,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 * @return never {@literal null}.
*/ */
public String getIdPropertyName(Class<?> type) { public String getIdPropertyName(Class<?> type) {

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2017-2020 the original author or authors. * Copyright 2017-2021 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,9 +88,9 @@ 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.Cursor} * Returns a {@link CloseableIterator} that wraps the a Mongo DB {@link com.mongodb.client.FindIterable}
* *
* @return a {@link CloseableIterator} that wraps the a Mongo DB {@link com.mongodb.Cursor} that needs to be closed. * @return a {@link CloseableIterator} that wraps the a Mongo DB {@link com.mongodb.client.FindIterable} that needs to be closed.
* Never {@literal null}. * Never {@literal null}.
*/ */
CloseableIterator<T> stream(); CloseableIterator<T> stream();

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2017-2020 the original author or authors. * Copyright 2017-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2017-2020 the original author or authors. * Copyright 2017-2021 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.
@@ -44,7 +44,7 @@ import com.mongodb.client.MongoCollection;
* query(Human.class) * query(Human.class)
* .inCollection("star-wars") * .inCollection("star-wars")
* .as(Jedi.class) * .as(Jedi.class)
* .matching(query(where("firstname").is("luke"))) * .matching(where("firstname").is("luke"))
* .all(); * .all();
* </code> * </code>
* </pre> * </pre>
@@ -118,7 +118,7 @@ public interface ExecutableFindOperation {
/** /**
* Stream all matching elements. * Stream all matching elements.
* *
* @return a {@link Stream} that wraps the a Mongo DB {@link com.mongodb.Cursor} that needs to be closed. Never * @return a {@link Stream} that wraps the a Mongo DB {@link com.mongodb.client.FindIterable} that needs to be closed. Never
* {@literal null}. * {@literal null}.
*/ */
Stream<T> stream(); Stream<T> stream();
@@ -174,13 +174,13 @@ public interface ExecutableFindOperation {
/** /**
* Set the filter {@link CriteriaDefinition criteria} to be used. * Set the filter {@link CriteriaDefinition criteria} to be used.
* *
* @param criteriaDefinition must not be {@literal null}. * @param criteria must not be {@literal null}.
* @return new instance of {@link TerminatingFind}. * @return new instance of {@link TerminatingFind}.
* @throws IllegalArgumentException if query is {@literal null}. * @throws IllegalArgumentException if criteria is {@literal null}.
* @since 3.0 * @since 3.0
*/ */
default TerminatingFind<T> matching(CriteriaDefinition criteriaDefinition) { default TerminatingFind<T> matching(CriteriaDefinition criteria) {
return matching(Query.query(criteriaDefinition)); return matching(Query.query(criteria));
} }
/** /**
@@ -304,9 +304,21 @@ public interface ExecutableFindOperation {
* *
* @param query must not be {@literal null}. * @param query must not be {@literal null}.
* @return new instance of {@link TerminatingDistinct}. * @return new instance of {@link TerminatingDistinct}.
* @throws IllegalArgumentException if resultType is {@literal null}. * @throws IllegalArgumentException if query is {@literal null}.
*/ */
TerminatingDistinct<T> matching(Query query); TerminatingDistinct<T> matching(Query query);
/**
* Set the filter {@link CriteriaDefinition criteria} to be used.
*
* @param criteria must not be {@literal null}.
* @return new instance of {@link TerminatingDistinct}.
* @throws IllegalArgumentException if criteria is {@literal null}.
* @since 3.0
*/
default TerminatingDistinct<T> matching(CriteriaDefinition criteria) {
return matching(Query.query(criteria));
}
} }
/** /**

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2017-2020 the original author or authors. * Copyright 2017-2021 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.
@@ -257,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> cursor) { public FindIterable<Document> prepare(FindIterable<Document> iterable) {
FindIterable<Document> target = delegate != null ? delegate.prepare(cursor) : cursor; FindIterable<Document> target = delegate != null ? delegate.prepare(iterable) : iterable;
return limit.map(target::limit).orElse(target); return limit.map(target::limit).orElse(target);
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2017-2020 the original author or authors. * Copyright 2017-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2017-2020 the original author or authors. * Copyright 2017-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2018-2020 the original author or authors. * Copyright 2018-2021 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.
@@ -152,13 +152,13 @@ public interface ExecutableMapReduceOperation {
/** /**
* Set the filter {@link CriteriaDefinition criteria} to be used. * Set the filter {@link CriteriaDefinition criteria} to be used.
* *
* @param criteriaDefinition must not be {@literal null}. * @param criteria must not be {@literal null}.
* @return new instance of {@link TerminatingMapReduce}. * @return new instance of {@link TerminatingMapReduce}.
* @throws IllegalArgumentException if query is {@literal null}. * @throws IllegalArgumentException if query is {@literal null}.
* @since 3.0 * @since 3.0
*/ */
default TerminatingMapReduce<T> matching(CriteriaDefinition criteriaDefinition) { default TerminatingMapReduce<T> matching(CriteriaDefinition criteria) {
return matching(Query.query(criteriaDefinition)); return matching(Query.query(criteria));
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2018-2020 the original author or authors. * Copyright 2018-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2017-2020 the original author or authors. * Copyright 2017-2021 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.
@@ -124,13 +124,13 @@ public interface ExecutableRemoveOperation {
/** /**
* Set the filter {@link CriteriaDefinition criteria} to be used. * Set the filter {@link CriteriaDefinition criteria} to be used.
* *
* @param criteriaDefinition must not be {@literal null}. * @param criteria must not be {@literal null}.
* @return new instance of {@link TerminatingRemove}. * @return new instance of {@link TerminatingRemove}.
* @throws IllegalArgumentException if query is {@literal null}. * @throws IllegalArgumentException if query is {@literal null}.
* @since 3.0 * @since 3.0
*/ */
default TerminatingRemove<T> matching(CriteriaDefinition criteriaDefinition) { default TerminatingRemove<T> matching(CriteriaDefinition criteria) {
return matching(Query.query(criteriaDefinition)); return matching(Query.query(criteria));
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2017-2020 the original author or authors. * Copyright 2017-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2017-2020 the original author or authors. * Copyright 2017-2021 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.
@@ -215,13 +215,13 @@ public interface ExecutableUpdateOperation {
/** /**
* Set the filter {@link CriteriaDefinition criteria} to be used. * Set the filter {@link CriteriaDefinition criteria} to be used.
* *
* @param criteriaDefinition must not be {@literal null}. * @param criteria must not be {@literal null}.
* @return new instance of {@link UpdateWithUpdate}. * @return new instance of {@link UpdateWithUpdate}.
* @throws IllegalArgumentException if query is {@literal null}. * @throws IllegalArgumentException if query is {@literal null}.
* @since 3.0 * @since 3.0
*/ */
default UpdateWithUpdate<T> matching(CriteriaDefinition criteriaDefinition) { default UpdateWithUpdate<T> matching(CriteriaDefinition criteria) {
return matching(Query.query(criteriaDefinition)); return matching(Query.query(criteria));
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2017-2020 the original author or authors. * Copyright 2017-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2020 the original author or authors. * Copyright 2010-2021 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 {@litearl source}. * Create new {@link FindAndModifyOptions} based on option of given {@literal 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 * @param collation can be {@literal null}.
* @return * @return this.
* @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 * @return never {@literal null}.
* @since 2.0 * @since 2.0
*/ */
public Optional<Collation> getCollation() { public Optional<Collation> getCollation() {

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2018-2020 the original author or authors. * Copyright 2018-2021 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 * @return {@literal true} if set.
*/ */
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 * @return {@literal true} if set.
*/ */
public boolean isUpsert() { public boolean isUpsert() {
return upsert; return upsert;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2016-2020 the original author or authors. * Copyright 2016-2021 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 * @return never {@literal null}.
* @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
*/ */

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2017-2020 the original author or authors. * Copyright 2017-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2016-2020 the original author or authors. * Copyright 2016-2021 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 * @return never {@literal null}.
*/ */
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 * @return never {@literal null}, uses {@link Double#NaN} if {@literal avgDistance} does not exist.
* @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() {

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2016-2020 the original author or authors. * Copyright 2016-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2018-2020 the original author or authors. * Copyright 2018-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2019-2020 the original author or authors. * Copyright 2019-2021 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.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2011-2020 the original author or authors. * Copyright 2011-2021 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