Skip to content

Commit c6e2662

Browse files
kdombeckmp911de
authored andcommitted
DATAMONGO-1577 - Fix Reference and JavaDoc spelling issues.
Replaced invalid class name MongoMappingConverter with actual class name of MappingMongoConverter. Fix typos. Original pull request: spring-projects#425.
1 parent 51ae618 commit c6e2662

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ private void prepareIndexCreator(ApplicationContext context) {
318318
}
319319

320320
/**
321-
* Returns the default {@link org.springframework.data.mongodb.core.core.convert.MongoConverter}.
321+
* Returns the default {@link org.springframework.data.mongodb.core.convert.MongoConverter}.
322322
*
323323
* @return
324324
*/

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011-2016 by the original author(s).
2+
* Copyright 2011-2017 by the original author(s).
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -330,12 +330,12 @@ public void doWithAssociation(Association<MongoPersistentProperty> association)
330330
* (non-Javadoc)
331331
* @see org.springframework.data.mongodb.core.convert.MongoWriter#toDBRef(java.lang.Object, org.springframework.data.mongodb.core.mapping.MongoPersistentProperty)
332332
*/
333-
public DBRef toDBRef(Object object, MongoPersistentProperty referingProperty) {
333+
public DBRef toDBRef(Object object, MongoPersistentProperty referringProperty) {
334334

335335
org.springframework.data.mongodb.core.mapping.DBRef annotation = null;
336336

337-
if (referingProperty != null) {
338-
annotation = referingProperty.getDBRef();
337+
if (referringProperty != null) {
338+
annotation = referringProperty.getDBRef();
339339
Assert.isTrue(annotation != null, "The referenced property has to be mapped with @DBRef!");
340340
}
341341

@@ -344,14 +344,14 @@ public DBRef toDBRef(Object object, MongoPersistentProperty referingProperty) {
344344
return ((LazyLoadingProxy) object).toDBRef();
345345
}
346346

347-
return createDBRef(object, referingProperty);
347+
return createDBRef(object, referringProperty);
348348
}
349349

350350
/**
351351
* Root entry method into write conversion. Adds a type discriminator to the {@link Document}. Shouldn't be called for
352352
* nested conversions.
353353
*
354-
* @see org.springframework.data.mongodb.core.core.convert.MongoWriter#write(java.lang.Object, com.mongodb.Document)
354+
* @see org.springframework.data.mongodb.core.convert.MongoWriter#write(java.lang.Object, com.mongodb.Document)
355355
*/
356356
public void write(final Object obj, final Bson bson) {
357357

src/main/asciidoc/reference/mapping.adoc

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
[[mapping-chapter]]
22
= Mapping
33

4-
Rich mapping support is provided by the `MongoMappingConverter`. `MongoMappingConverter` has a rich metadata model that provides a full feature set of functionality to map domain objects to MongoDB documents.The mapping metadata model is populated using annotations on your domain objects. However, the infrastructure is not limited to using annotations as the only source of metadata information. The `MongoMappingConverter` also allows you to map objects to documents without providing any additional metadata, by following a set of conventions.
4+
Rich mapping support is provided by the `MappingMongoConverter`. `MappingMongoConverter` has a rich metadata model that provides a full feature set of functionality to map domain objects to MongoDB documents.The mapping metadata model is populated using annotations on your domain objects. However, the infrastructure is not limited to using annotations as the only source of metadata information. The `MappingMongoConverter` also allows you to map objects to documents without providing any additional metadata, by following a set of conventions.
55

6-
In this section we will describe the features of the `MongoMappingConverter`. How to use conventions for mapping objects to documents and how to override those conventions with annotation based mapping metadata.
6+
In this section we will describe the features of the `MappingMongoConverter`. How to use conventions for mapping objects to documents and how to override those conventions with annotation based mapping metadata.
77

88
NOTE: `SimpleMongoConverter` has been deprecated in Spring Data MongoDB M3 as all of its functionality has been subsumed into `MappingMongoConverter`.
99

1010
[[mapping-conventions]]
1111
== Convention based Mapping
1212

13-
`MongoMappingConverter` has a few conventions for mapping objects to documents when no additional mapping metadata is provided. The conventions are:
13+
`MappingMongoConverter` has a few conventions for mapping objects to documents when no additional mapping metadata is provided. The conventions are:
1414

1515
* The short Java class name is mapped to the collection name in the following manner. The class `com.bigbank.SavingsAccount` maps to `savingsAccount` collection name.
1616
* All nested objects are stored as nested objects in the document and *not* as DBRefs
@@ -21,7 +21,7 @@ NOTE: `SimpleMongoConverter` has been deprecated in Spring Data MongoDB M3 as al
2121
[[mapping.conventions.id-field]]
2222
=== How the `_id` field is handled in the mapping layer
2323

24-
MongoDB requires that you have an `_id` field for all documents. If you don't provide one the driver will assign a ObjectId with a generated value. The "_id" field can be of any type the, other than arrays, so long as it is unique. The driver naturally supports all primitive types and Dates. When using the `MongoMappingConverter` there are certain rules that govern how properties from the Java class is mapped to this `_id` field.
24+
MongoDB requires that you have an `_id` field for all documents. If you don't provide one the driver will assign a ObjectId with a generated value. The "_id" field can be of any type the, other than arrays, so long as it is unique. The driver naturally supports all primitive types and Dates. When using the `MappingMongoConverter` there are certain rules that govern how properties from the Java class is mapped to this `_id` field.
2525

2626
The following outlines what field will be mapped to the `_id` document field:
2727

@@ -246,9 +246,9 @@ calling `get()` before the actual conversion
246246
[[mapping-configuration]]
247247
== Mapping Configuration
248248

249-
Unless explicitly configured, an instance of `MongoMappingConverter` is created by default when creating a `MongoTemplate`. You can create your own instance of the `MappingMongoConverter` so as to tell it where to scan the classpath at startup your domain classes in order to extract metadata and construct indexes. Also, by creating your own instance you can register Spring converters to use for mapping specific classes to and from the database.
249+
Unless explicitly configured, an instance of `MappingMongoConverter` is created by default when creating a `MongoTemplate`. You can create your own instance of the `MappingMongoConverter` so as to tell it where to scan the classpath at startup your domain classes in order to extract metadata and construct indexes. Also, by creating your own instance you can register Spring converters to use for mapping specific classes to and from the database.
250250

251-
You can configure the `MongoMappingConverter` as well as `com.mongodb.Mongo` and MongoTemplate either using Java or XML based metadata. Here is an example using Spring's Java based configuration
251+
You can configure the `MappingMongoConverter` as well as `com.mongodb.Mongo` and MongoTemplate either using Java or XML based metadata. Here is an example using Spring's Java based configuration
252252

253253
.@Configuration class to configure MongoDB mapping support
254254
====

src/main/asciidoc/reference/mongodb.adoc

+4-4
Original file line numberDiff line numberDiff line change
@@ -436,15 +436,15 @@ The class `MongoTemplate`, located in the package `org.springframework.data.mong
436436

437437
NOTE: Once configured, `MongoTemplate` is thread-safe and can be reused across multiple instances.
438438

439-
The mapping between MongoDB documents and domain classes is done by delegating to an implementation of the interface `MongoConverter`. Spring provides two implementations, `SimpleMappingConverter` and `MongoMappingConverter`, but you can also write your own converter. Please refer to the section on MongoConverters for more detailed information.
439+
The mapping between MongoDB documents and domain classes is done by delegating to an implementation of the interface `MongoConverter`. Spring provides two implementations, `SimpleMappingConverter` and `MappingMongoConverter`, but you can also write your own converter. Please refer to the section on MongoConverters for more detailed information.
440440

441441
The `MongoTemplate` class implements the interface `MongoOperations`. In as much as possible, the methods on `MongoOperations` are named after methods available on the MongoDB driver `Collection` object to make the API familiar to existing MongoDB developers who are used to the driver API. For example, you will find methods such as "find", "findAndModify", "findOne", "insert", "remove", "save", "update" and "updateMulti". The design goal was to make it as easy as possible to transition between the use of the base MongoDB driver and `MongoOperations`. A major difference in between the two APIs is that MongoOperations can be passed domain objects instead of `Document` and there are fluent APIs for `Query`, `Criteria`, and `Update` operations instead of populating a `Document` to specify the parameters for those operations.
442442

443443
NOTE: The preferred way to reference the operations on `MongoTemplate` instance is via its interface `MongoOperations`.
444444

445-
The default converter implementation used by `MongoTemplate` is MongoMappingConverter. While the `MongoMappingConverter` can make use of additional metadata to specify the mapping of objects to documents it is also capable of converting objects that contain no additional metadata by using some conventions for the mapping of IDs and collection names. These conventions as well as the use of mapping annotations is explained in the <<mongo.mapping,Mapping chapter>>.
445+
The default converter implementation used by `MongoTemplate` is MappingMongoConverter. While the `MappingMongoConverter` can make use of additional metadata to specify the mapping of objects to documents it is also capable of converting objects that contain no additional metadata by using some conventions for the mapping of IDs and collection names. These conventions as well as the use of mapping annotations is explained in the <<mongo.mapping,Mapping chapter>>.
446446

447-
NOTE: In the M2 release `SimpleMappingConverter`, was the default and this class is now deprecated as its functionality has been subsumed by the `MongoMappingConverter`.
447+
NOTE: In the M2 release `SimpleMappingConverter`, was the default and this class is now deprecated as its functionality has been subsumed by the `MappingMongoConverter`.
448448

449449
Another central feature of MongoTemplate is exception translation of exceptions thrown in the MongoDB Java driver into Spring's portable Data Access Exception hierarchy. Refer to the section on <<mongo.exception,exception translation>> for more information.
450450

@@ -659,7 +659,7 @@ The query syntax used in the example is explained in more detail in the section
659659
[[mongo-template.id-handling]]
660660
=== How the `_id` field is handled in the mapping layer
661661

662-
MongoDB requires that you have an `_id` field for all documents. If you don't provide one the driver will assign a `ObjectId` with a generated value. When using the `MongoMappingConverter` there are certain rules that govern how properties from the Java class is mapped to this `_id` field.
662+
MongoDB requires that you have an `_id` field for all documents. If you don't provide one the driver will assign a `ObjectId` with a generated value. When using the `MappingMongoConverter` there are certain rules that govern how properties from the Java class is mapped to this `_id` field.
663663

664664
The following outlines what property will be mapped to the `_id` document field:
665665

0 commit comments

Comments
 (0)