Menu

#146 bug in MappingProcessor.checkForSuperTypeMapping()

Dozer v.4.3
open
None
5
2008-10-22
2008-07-18
No

checkForSuperTypeMapping() looks for mappings for the superclasses of two classes, but only finds the mapping for the direct superclass, not for any superclasses higher up in the class hierarchy.

The attachment contains a package called 'dozer', which contains several classes and a mapping config.

The classes consist of two parallel hierarchies: ZeroA is the base class of OneA, which is the base class of TwoA. Similar for ZeroB, OneB, TwoB. The mapping config file contains three mappings: ZeroA - ZeroB, OneA - OneB, TwoA - TwoB.

The base classes ZeroA and ZeroB have a field 'id'. The ZeroA - ZeroB mapping contains an exclude-field for field 'id'.

If I map instances of OneA and OneB, the field is excluded, because the mappings OneA - OneB and ZeroA - ZeroB are used.

If I map instances of TwoA and TwoB, the field is *not* excluded, because *only* the mappings TwoA - TwoB and OneA - OneB are used. The mapping ZeroA - ZeroB is ignored.

Class dozer.DozerTest demonstrates this.

Discussion

  • Christopher Sahnwaldt

    test classes and config files

     
  • dmitry (lv)

    dmitry (lv) - 2008-10-22
    • milestone: --> Dozer v.4.3
    • assigned_to: nobody --> buzdin
     
  • dmitry (lv)

    dmitry (lv) - 2008-10-28

    Existing workaround is to use wildcard=false for class mappings of the hierarchy.

     

Log in to post a comment.

MongoDB Logo MongoDB