title: MapStruct - custom mapping of target field based on 2 or more different source objects
body: <p>I am trying to figure out how to implement the following mapping:</p>
  <pre><code>class SuperComplexClass {
      Long value;
      String description;
  }
  
  class MapIntoMe {
      
      // Many other fields that is also mapped
      
      SuperComplexClass superComplexObject;
  }
  
  class MapFromMe {
      ComplexClassPart1 complexClassPart;
  }
  
  class AdditionalData {
      ComplexClassPart2 complexClassPart;
  }
  
  
  @Mapper
  public interface SomeFancyMapper {
  
      @Mapping(target = &quot;superComplexObject&quot;, source = &quot;{mfm.complexPart, ad.complexPart}&quot;,
               qualifiedByName = &quot;mapSuperComplexObject&quot;)
      MapIntoMe mapFromMeIntoMe(MapFromMe mfm, AdditionalData ad);
      
  
      @Named(&quot;mapSuperComplexObject&quot;)
      default SuperComplexClass mapSuperComplexObject(ComplexPart1 p1, ComplexPart2 p2) {
          SuperComplexClass superObject = new SuperComplexClass();
          //some logic that calculates and fills superObject]
          return superObject;
      }
  }
  </code></pre>
  <p>And now obviously expression like <code>source = &quot;{mfm.complexPart, ad.complexPart}&quot;</code> is not working, but it shows clearly what I would like to achieve.</p>
  <p>So far I wasn't able to find the answer if that's possible with this approach and without some ugly workarounds.</p>
  <p>Any ideas?</p>