title: Mybatis xml resultMap with collection and association issue
body: <p>i m actually testing mybatis. I like really but, i want to go deeper and i have a problem, with resultMap.</p>
  
  <p>Actually i just want to get from database a computer object, which is composed of multiple screens and one tower (other object of my code)</p>
  
  <p>This is my resultMap for computer :</p>
  
  <pre><code>&lt;resultMap type="entity.Computer" id="computer"&gt;
          &lt;id column="id" property="id"/&gt;
          &lt;result column="name" property="name"/&gt;
          &lt;association property="tower" column="towerid" resultMap="towerResult" columnPrefix="t_"/&gt;
          &lt;collection ofType="entity.Screen" property="screen" javaType="ArrayList" resultMap="screenResult" columnPrefix="s_"/&gt;
      &lt;/resultMap&gt;
  </code></pre>
  
  <p>this the request : </p>
  
  <pre><code>&lt;select id="getcomputerById" resultMap="computer"&gt;
          Select c.id, c.name, c.towerid, s.id as s_id, s.size as s_size, s.type as s_type, s.computer_id as s_computer_id, t.id as t_id, t.ram as t_ram, t.stockage as t_stockage from computer c inner join tower t on t.id = c.towerid left join screen s ON s.computer_id = c.id where c.id=#{computerId}
      &lt;/select&gt;
  </code></pre>
  
  <p>With this code everything works fine. BUTTTTTTTT !
  What i wanted to do is :</p>
  
  <pre><code>&lt;resultMap type="entity.Computer" id="computer"&gt;
          &lt;id column="id" property="id"/&gt;
          &lt;result column="name" property="name"/&gt;
          &lt;association property="tower" column="towerid" select="getTowerbycomputerid"/&gt;
          &lt;collection ofType="entity.Screen" property="screen" javaType="ArrayList" resultMap="screenResult" columnPrefix="s_"/&gt;
      &lt;/resultMap&gt;
  </code></pre>
  
  <p>The only thing different is : <code>&lt;association property="tower" column="towerid" select="getTowerbycomputerid"/&gt;</code></p>
  
  <p>Of course i change my request to : </p>
  
  <pre><code>&lt;select id="getcomputerById" resultMap="computer"&gt;
          Select c.id, c.name, c.towerid, s.id as s_id, s.size as s_size, s.type as s_type, s.computer_id as s_computer_id from computer c inner join tower t on t.id = c.towerid left join screen s ON s.computer_id = c.id where c.id=#{computerId}
      &lt;/select&gt;
  </code></pre>
  
  <p>There is the xml match the getTowerbycomputerid :</p>
  
  <pre><code>&lt;select id="getTowerbycomputerid" resultMap="towerResult"&gt;
          Select t.id, t.ram, t.stockage from tower t inner join computer c on c.towerid=t.id where c.id=#{computerId}
      &lt;/select&gt;
  </code></pre>
  
  <p>And the resultMap : </p>
  
  <pre><code>&lt;resultMap id="towerResult" type="entity.Tower"&gt;
          &lt;id property="id" column="id"/&gt;
          &lt;result property="ram" column="ram"/&gt;
          &lt;result property="stockage" column="stockage"/&gt;
      &lt;/resultMap&gt;
  </code></pre>
  
  <p>I don't understand why the second resultmap don't work.
  If i have one-one tower and one-one Screen
  I can have a resultmap, with two association and in them a select="getmethod"
  And it work perfectly
  But when i change my code to have one-one tower and one-many Screen, i can't let select="getmethod" for the last association.
  It return null for the one-one, but the one-many work (with the right select statement).</p>
  
  <p>Any idea ?
  Maybe it's not possible to do it?</p>
  
  <p>THx :)</p>