Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-4578

Java driver cannot handle Deeper Polymorphic trees

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • 4.3.4
    • BSON, Codecs, POJO
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

    Description

      The Pojo codec is limited in handling multiple level generic types that are passed through the class heirarchy.

      Take the following classes:

      abstract class GenericBaseModel<A, B, C> {
       
          private A alpha;
          private B bravo;
          private C charlie;
         
         // ... getters & setters
      }
       
      public abstract class GenericPassThroughModel<A, B, C> extends GenericBaseModel<C, B, A> {
       
      }
       
      public final class GenericPassThroughModelImpl extends GenericPassThroughModel<List<String>, Integer, String> {
       
      }
      

      The concrete types of GenericPassThroughModelImpl are lost due to the PojoCodecs type detection.


      See first comment for the previous description.

      Attachments

        Activity

          People

            ross@mongodb.com Ross Lawley
            contact@gjstewart.net Greg Stewart
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: