Menu

Specify a concrete impl for Interface/Abstrac

Dave E
2005-08-12
2013-05-02
<< < 1 2 (Page 2 of 2)
  • Ben Sullins

    Ben Sullins - 2005-10-28

    Matthias,

    I should have some time this weekend or earlier to look at this. 

    thanks,

    Ben

     
  • Franz Garsombke

    Franz Garsombke - 2005-10-30

    I have fixed this for the 1.5.6 release. We were checking for class type to class type. We never checked for interface or super types (i.e. isAssignable()).

    Still have to be careful with the use of this. You could have  a problem where you have some really generic base interface or super class. You could then accidentally have things mapped you were not expecting.

    Thanks.

    Franz

     
  • Franz Garsombke

    Franz Garsombke - 2005-10-30

    BTW - I opened this as bug 1342127

     
  • Matthias Schäfer

    Hello Franz,

    my Problem is now fixed with 1.5.6.

    Thanks Matthias

     
  • Olivier Gerardin

    Hi there,

    I'm resuscitating this thread because we have a problem I think fits here.

    To simplify let's say we have a class hierarchy with an abstract superclass S and subclasses A and B.
    We also have a mirroring hierarchy SPrime,  APrime and BPrime.
    We want to use dozer to convert an instance of S to an instance of SPrime. Each class has its own mapping, with common properties mapped in the S-&gt;SPrime mapping file, and A-&gt;APrime and B-&gt;BPrime containing only their own mappings.

    So we try to call mapper.map(s, SPrime.class), but we get InstantiationException because Dozer tries to instantiate SPrime, which is abstract.

    Reading this thread, we expected Dozer to instantiate either APrime or BPrime depending on the actual runtime class of s, which obviously is not the case.

    Is there anything we are missing? Does the polymorphic mapping only apply to properties, not root objects?

    Any help appreciated.

     
  • scasas

    scasas - 2010-02-09

    Sorry my ignorance, but I have the same problem and not know what to do, I'm using dozer 4.2 How do I apply the patch to the jar?
    thanks

     
<< < 1 2 (Page 2 of 2)

Log in to post a comment.