Browse Source

DATAMONGO-2457 - Fix id type explanation in repository documentation.

Original pull request: #829.
pull/832/head
Christoph Strobl 6 years ago committed by Mark Paluch
parent
commit
ecc9f3fd60
No known key found for this signature in database
GPG Key ID: 51A00FA751B91849
  1. 5
      src/main/asciidoc/reference/mongo-repositories.adoc
  2. 5
      src/main/asciidoc/reference/reactive-mongo-repositories.adoc

5
src/main/asciidoc/reference/mongo-repositories.adoc

@ -28,7 +28,10 @@ public class Person { @@ -28,7 +28,10 @@ public class Person {
----
====
Note that the domain type shown in the preceding example has a property named `id` of type `ObjectId`. The default serialization mechanism used in `MongoTemplate` (which backs the repository support) regards properties named `id` as the document ID. Currently, we support `String`, `ObjectId`, and `BigInteger` as ID types. Now that we have a domain object, we can define an interface that uses it, as follows:
Note that the domain type shown in the preceding example has a property named `id` of type `String`. The default serialization mechanism used in `MongoTemplate` (which backs the repository support) regards properties named `id` as the document ID. Currently, we support `String`, `ObjectId`, and `BigInteger` as ID types.
Please see <<mongo-template.id-handling, ID mapping>> for more information about on how the `id` field is handled in the mapping layer.
Now that we have a domain object, we can define an interface that uses it, as follows:
.Basic repository interface to persist Person entities
====

5
src/main/asciidoc/reference/reactive-mongo-repositories.adoc

@ -41,7 +41,10 @@ public class Person { @@ -41,7 +41,10 @@ public class Person {
----
====
Note that the entity defined in the preceding example has a property named `id` of type `ObjectId`. The default serialization mechanism used in `MongoTemplate` (which backs the repository support) regards properties named `id` as the document ID. Currently, we support `String`, `ObjectId`, and `BigInteger` as id-types. The following example shows how to create an interface that defines queries against the `Person` object from the preceding example:
Note that the entity defined in the preceding example has a property named `id` of type `String`. The default serialization mechanism used in `MongoTemplate` (which backs the repository support) regards properties named `id` as the document ID. Currently, we support `String`, `ObjectId`, and `BigInteger` as id-types.
Please see <<mongo-template.id-handling, ID mapping>> for more information about on how the `id` field is handled in the mapping layer.
The following example shows how to create an interface that defines queries against the `Person` object from the preceding example:
.Basic repository interface to persist Person entities
====

Loading…
Cancel
Save