Dozer 6.5.0 skips field mapping for child entities mapping

24 views
Skip to first unread message

Maksym Lopushanskyi

unread,
Oct 8, 2021, 3:21:22 AM10/8/21
to Dozer Mapper
I have Class1, ReferenceClass1 and Class1Dto,  ReferenceClass1DTO .
I have mapping:
 mapping( Class1.class,  Class1Dto.class, TypeMappingOptions.oneWay())
.fields("ref", "ref",
hintA( ReferenceClass1.class),
hintB(  ReferenceClass1DTO  ), oneWay())
.fields("a""b",
hintA( ReferenceClass1.class),
hintB(  ReferenceClass1DTO.class  ), oneWay());

"ref" is List in both classes.
P.S. I do not have access to the source code.

Then I need to create my own data model:
MyClass1 extends Class1, MyReferenceClass1 extends ReferenceClass1,
MyClass1Dto extends Class1Dto, MyReferenceClass1DTO extends ReferenceClass1DTO.

I am trying to extend existed mapping:
 mapping( MyClass1.class,  MyClass1Dto.class, TypeMappingOptions.oneWay())
.fields("ref""ref",
hintA( ReferenceClass1.class, MyReferenceClass1.class),
hintB(  ReferenceClass1DTO.class , MyReferenceClass1DTO.class ), oneWay());

In fact instance of MyClass1 transforms to MyClass1DTO.class
but 'ref' that contains instances of MyReferenceClass1 does not transforms and MyClass1DTO.ref has List of MyReferenceClass1 instead of MyReferenceClass1DTO.class
Reply all
Reply to author
Forward
0 new messages