Skip to content

Commit 0bfb32a

Browse files
christophstroblmp911de
authored andcommitted
Update documentation regarding java.time type conversion.
Closes #3482 Original pull request: #4460
1 parent ca44302 commit 0bfb32a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/asciidoc/reference/mapping.adoc

+8
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,14 @@ You can add additional converters to the converter by overriding the `customConv
350350
MongoDB's native JSR-310 support can be enabled through `MongoConverterConfigurationAdapter.useNativeDriverJavaTimeCodecs()`.
351351
Also shown in the preceding example is a `LoggingEventListener`, which logs `MongoMappingEvent` instances that are posted onto Spring's `ApplicationContextEvent` infrastructure.
352352

353+
[TIP]
354+
====
355+
.Java Time Types
356+
357+
We recommend using MongoDB's native JSR-310 support via `MongoConverterConfigurationAdapter.useNativeDriverJavaTimeCodecs()` as described above as it is using an `UTC` based approach.
358+
The default JSR-310 support for `java.time` types inherited from Spring Data Commons uses the local machine timezone as reference and should only be used for backwards compatibility.
359+
====
360+
353361
NOTE: `AbstractMongoClientConfiguration` creates a `MongoTemplate` instance and registers it with the container under the name `mongoTemplate`.
354362

355363
The `base-package` property tells it where to scan for classes annotated with the `@org.springframework.data.mongodb.core.mapping.Document` annotation.

0 commit comments

Comments
 (0)