title: Dozer: Map single field into a List
body: <p>How do you map a single field into a <code>List</code> / <code>Collection</code> in Dozer?</p>
  
  <pre><code>class SrcFoo {
      private String id;
      private List&lt;SrcBar&gt; bars;
  }
  
  class SrcBar {
      private String name;
  }
  </code></pre>
  
  <p>Here are my destination objects:</p>
  
  <pre><code>class DestFoo {
      private List&lt;DestBar&gt; destBars;
  }
  
  class DestBar {
      private String fooId; // Populated by SrcFoo.id
      private String barName;
  }
  </code></pre>
  
  <p>I want all <code>DestBar.fooId</code> (entire list of DestBars) to be populated with <code>SrcFoo.id</code></p>
  
  <p>This question is similar to this one posted here, expect I want to map my single field to every item in the list. <a href="https://stackoverflow.com/questions/4801593/dozer-map-single-field-to-set">Dozer: map single field to Set</a></p>
  
  <p>I tried the following, but it only populated <code>DestBar.fooId</code> for the first item in the list.</p>
  
  <pre><code>&lt;mapping&gt; 
       &lt;class-a&gt;SrcFoo&lt;/class-a&gt; 
       &lt;class-b&gt;DestFoo&lt;/class-b&gt; 
       &lt;field&gt;
           &lt;a&gt;bars&lt;/a&gt;
           &lt;b&gt;destBars&lt;/b&gt;
       &lt;/field&gt; 
       &lt;field&gt;
           &lt;a&gt;id&lt;/a&gt;
           &lt;b&gt;destBars.fooId&lt;/b&gt; &lt;!-- same affect as destBars[0].fooId ? --&gt;
       &lt;/field&gt; 
  &lt;/mapping&gt;
  </code></pre>