mapstruct-idea icon indicating copy to clipboard operation
mapstruct-idea copied to clipboard

IntelliJ plugin reporting "Unmapped target property" although the property is sucesfully mapped by MapStruct for fields of child classes.

Open Hobbesgoblin opened this issue 3 years ago • 0 comments

When I generate my Mapping with Mapstruct, the Mapstruct Plugin reports unmapped proeprties, although the implementation has them mapped.

this seems to have to to do with inheritance, since the reportedly unmapped fields are the fields that the class has on its own. Inherited fields are NOT reported as unmapped.

My entities use lomboks @Superbuilder due to inheritance and my DTOs are records

I have the folling structure

Class 1 field A field B

Class 2 extends class 1 Field C Field D

Class 2a extends class 2 Field E

Class 2b extends class 2 Field F

in my mappers "class2aDtoToClass2a" and "class2bDtoToClass2b" fields E and F are reportedly unmapped respectivly If I check the implementation, all fields are correctly mapped, regardless of where in the inheritance classes 2a and 2b gain them from.

Hobbesgoblin avatar Oct 19 '22 08:10 Hobbesgoblin