Relative Content

Tag Archive for mapstruct

Unable to map the fields of Class from two classes in mapstruct

@Mapping(source = “key.locationType”, target = “basicLocation.locationTypeCode”) @Mapping(source = “detail.locationName”, target = “basicLocation.locationName”) LocationRequest toRequest(CachedLocationKey key, CachedLocationDetail detail); i am trying to map the object basicLocation in LocationRequest. locationType comes from key and locationName comes from detail. If i write both the mappings , there comes the below error : @Mapping(source = “key.locationType”, target = “basicLocation.locationTypeCode”) […]