title: java mapstruct - mapping a field inside related collection
body: <p>I want to use mapstruct library for mapping models list to dto list in my spring application. Suppose I have two models something like this:</p>
  
  <pre><code>public class Employee {
      private Integer id;
      private String name;
      private Set&lt;Phone&gt; phones;
  }
  
  public class Phone {
      private Integer id;
      private String number;
  }
  </code></pre>
  
  <p>And here is my two dtos:</p>
  
  <pre><code>public class EmployeeDto {
      private Integer id;
      private String name;
      private Set&lt;PhoneDto&gt; phones;
  }
  
  public class PhoneDto {
      private Integer id;
      private String num;
  }
  </code></pre>
  
  <p>And finally I'm using this method in my mapping class:</p>
  
  <pre><code>@Mappings({
          @Mapping(target = "num", source = "phones.number")
  })
  public abstract List&lt;EmployeeDto&gt; toEmployeeDtoList(List&lt;Employee&gt; employeeList);
  </code></pre>
  
  <p>But this returns me <code>java: No property named "phones.number" exists in source parameter(s).</code> when I want to compile. I know something is wrong with my code, but I can't find something useful for my need. Can you please help me for solving this problem?</p>