@@ -749,7 +749,7 @@ see the following API Documentation:
749
749
750
750
For more information about generics and type parameters, see the
751
751
`Java language guide on Invoking and Instantiating a Generic Type <https://docs.oracle.com/javase/tutorial/java/generics/types.html#instantiation>`__.
752
-
752
+
753
753
Enum Type Support
754
754
^^^^^^^^^^^^^^^^^
755
755
@@ -759,31 +759,14 @@ a codec for ``enum`` types if you need one, such as the one in the default
759
759
codec registry.
760
760
761
761
See the documentation on the :ref:`default codec registry <codecs-default-codec-registry>`
762
- For more information about how to register the codecs it includes.
762
+ for more information about how to register the codecs it includes.
763
763
764
764
Frequently Asked Questions
765
765
--------------------------
766
766
767
767
This section answers questions that may arise when defining
768
768
data conversion logic.
769
769
770
- Do I have to specify an ID field value myself?
771
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
772
-
773
- No, the ``PojoCodecProvider`` automatically generates an ObjectId.
774
-
775
- Can the ID field be a compound key?
776
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
777
-
778
- Yes. For an example of this, see `our implementation <https://github.com/niccottrell/mongo-java-tests/blob/master/src/test/PojoCompoundIdTest.java>`__
779
- in Github.
780
-
781
- Can I use polymorphism in a POJO accessor?
782
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
783
-
784
- Yes, by using a discriminator. For more information, see the :ref:`Discriminators
785
- <pojo-discriminators>` section.
786
-
787
770
Can I control serialization of ``LocalDate``?
788
771
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
789
772
@@ -812,25 +795,6 @@ You can configure the ``PojoCodecProvider`` to use the
812
795
``SET_PRIVATE_FIELDS_CONVENTION``, which sets a private field through
813
796
reflection if no public setter is available.
814
797
815
- Can I mix private, protected, and public setters and getters?
816
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
817
-
818
- No. The native POJO codec assumes that getters and setters have the same
819
- modifiers for each field.
820
-
821
- For example, the following methods throws an exception during encoding:
822
-
823
- .. code-block:: java
824
-
825
- private String getField();
826
- public String setField(String x);
827
-
828
- How do I fix: "org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for class X."?
829
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
830
-
831
- This exception means you must register a codec for the class since
832
- none exist.
833
-
834
798
How do I specify the collection name for a particular POJO class? Is there an annotation?
835
799
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
836
800
0 commit comments