title: Mybatis "java.lang.IllegalArgumentException: Result Maps collection already contains value for" error when mapping nested classes
body: <p>I'm getting a java.lang.IllegalArgumentException: Result Maps collection already contains value for" error when trying to do some XML mappings on a nested class:</p>
  
  <p>I have the following nested classes structure:</p>
  
  <pre><code>package com.test;   
  public class ObjectA {
    private List&lt;ObjectB&gt; entries;
  
    public ObjectA(List&lt;ObjectB&gt;  entries) {
      this.entries = entries;
    }
  
    public void setEntries(List&lt;ObjectB&gt; entries) {
      this.entries = entries;
    }
  
    public List&lt;ObjectB&gt; getEntries() {
      return this.entries;
    }
  
    public class ObjectB {
      private String param1;
  
      public ObjectB(String param1) {
          this.param1 = param1;
      }
  
      public void setParam1(String param1) {
          this.param1 = param1;
      }
  
      public String getParam1() {
          return this.param1;
      }
  
    }
  }
  </code></pre>
  
  <p>And the xml mappers look like this:</p>
  
  <pre><code>&lt;resultMap id="ObjectA" type="com.test.ObjectA"&gt;
      &lt;collection property="entries" resultMap="Entries"/&gt;
  &lt;/resultMap&gt;
  &lt;resultMap id="Entries" type="com.test.ObjectA.ObjectB"&gt;
      &lt;result property="param1" column="column1"/&gt;
  &lt;/resultMap&gt;
  </code></pre>
  
  <p>If i take the ObjectB class outside of ObjectA class, the mapping works fine. But the thing is that i don't want to do that. I want to have it nested.</p>
  
  <p>Thanks </p>