@@ -24,6 +24,7 @@ A `ClassModel` for a POJO includes:
24
24
* An optional discriminator value. The discriminator is the value used to represent the POJO class being stored.
25
25
* An optional discriminator key. The document key name for the discriminator.
26
26
* The use discriminator flag. This determines if the discriminator should be serialized. By default it is off.
27
+ * An optional IdGenerator used to generate the ` id ` value, when inserting the POJO. (New in 3.10)
27
28
28
29
Each ` PropertyModel ` includes:
29
30
@@ -318,10 +319,12 @@ The following Conventions are available from the [`Conventions`]({{<apiref "org/
318
319
the PropertyModels. If the ` idProperty ` isn't set and there is a property named ` _id ` or ` id ` then it will be marked as the ` idProperty ` .
319
320
* The [ ` SET_PRIVATE_FIELDS_CONVENTION ` ] ({{<apiref "org/bson/codecs/pojo/Conventions.html#SET_PRIVATE_FIELDS_CONVENTION">}}). Enables
320
321
private fields to be set directly using reflection, without the need of a setter method. Note this convention is not enabled by default.
321
- * The [ ` USE_GETTERS_FOR_SETTERS ` ] ({{<apiref "org/bson/codecs/pojo/Conventions.html#USE_GETTERS_FOR_SETTERS">}}). Allows getters to be used
322
+ * The [ ` USE_GETTERS_FOR_SETTERS ` ] ({{<apiref "org/bson/codecs/pojo/Conventions.html#USE_GETTERS_FOR_SETTERS">}}) convention . Allows getters to be used
322
323
for Map and Collection properties without setters, the collection/map is then mutated. Note this convention is not enabled by default.
324
+ * The [ ` OBJECT_ID_GENERATORS ` ] ({{<apiref "org/bson/codecs/pojo/Conventions.html#OBJECT_ID_GENERATORS">}}) convention. Adds an ` IdGenerator ` that
325
+ generates new ` ObjectId ` for ClassModels that have an ` ObjectId ` value for the ` id ` property.
323
326
* The [ ` DEFAULT_CONVENTIONS ` ] ({{<apiref "org/bson/codecs/pojo/Conventions.html#DEFAULT_CONVENTIONS">}}), a list containing the
324
- ` ANNOTATION_CONVENTION ` and the ` CLASS_AND_PROPERTY_CONVENTION ` .
327
+ ` ANNOTATION_CONVENTION ` , the ` CLASS_AND_PROPERTY_CONVENTION ` and the ` OBJECT_ID_GENERATORS ` convention .
325
328
* The [ ` NO_CONVENTIONS ` ] ({{<apiref "org/bson/codecs/pojo/Conventions.html#NO_CONVENTIONS">}}) an empty list.
326
329
327
330
Custom Conventions can either be set globally via the
0 commit comments