Allow discriminators to be used in a collection.

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 3.6.0
    • Affects Version/s: None
    • Component/s: POJO
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      PR: https://github.com/mongodb/mongo-java-driver/pull/416

      Right now, there is no way to serialize/deserialize a collection of abstract class or interface correctly, even though BsonDiscriminator annotation is added to all relevant classes (i.e. both parent class and all sub-classes). This patch fixes this problem by using the codec of the actual class of the value during encoding instead of the declared class. The decoding already uses a similar process.

              Assignee:
              Ross Lawley
              Reporter:
              Ross Lawley
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: