Java driver cannot handle Deeper Polymorphic trees

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: 4.3.4
    • Component/s: 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?
    • None
    • None
    • None
    • None
    • None
    • None

      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.

              Assignee:
              Ross Lawley
              Reporter:
              Greg Stewart
              None
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: