DATAMONGO-2457 - Fix id type explanation in repository documentation.
Original pull request: #829.
This commit is contained in:
committed by
Mark Paluch
parent
5cc044b72c
commit
aee5f71229
@@ -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
|
||||
====
|
||||
|
||||
@@ -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
|
||||
====
|
||||
|
||||
Reference in New Issue
Block a user