title: MyBatis TooManyResultsException for seemingly correct mapping
body: <p>For the sake of resolving this problem I have pared down a lot of my code.</p>
  
  <p>I continue to get this error as I try different things to get this collection working:</p>
  
  <blockquote>
    <p>nested exception is
    org.apache.ibatis.exceptions.TooManyResultsException: Expected one
    result (or null) to be returned by selectOne(), but found: 2</p>
  </blockquote>
  
  <p>Relevant objects are as follows:</p>
  
  <pre><code>class Recipe {
      String name
      List&lt;RecipeIngredient&gt; ingredients
  }
  class RecipeIngredient {
      Double measurementAmount
  }
  </code></pre>
  
  <p>I have an interface with my method call:</p>
  
  <pre><code>public interface CookbookDao {
      public Recipe getRecipe(@Param("id")int id)
  }
  </code></pre>
  
  <p>And my result mapper:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          "http://mybatis.org/dtd/mybatis-3-mapper.dtd"&gt;
  
  &lt;mapper namespace="cookbook.daos.CookbookDao"&gt;
      &lt;select id="getRecipe" resultMap="Recipe"&gt;
          SELECT
            r.name,
            ri.measurement_amount
          FROM
            recipe r
            INNER JOIN recipe_ingredient ri on ri.recipe_id = r.id
          WHERE
            r.id = #{id}
      &lt;/select&gt;
  
      &lt;resultMap id="Recipe" type="cookbook.domain.Recipe"&gt;
          &lt;result property="name" column="r.name" /&gt;
          &lt;collection property="ingredients" ofType="cookbook.domain.RecipeIngredient"&gt;
              &lt;result property="measurementAmount" column="ri.measurement_amount"/&gt;
          &lt;/collection&gt;
      &lt;/resultMap&gt;
  &lt;/mapper&gt;
  </code></pre>
  
  <p>The query returns the following results (Note: While the above code only has "measurement_amount" I've included what the actual, end-result set looks like to help show why I want/need to get these 2 rows back):</p>
  
  <pre><code> name | measurement_amount | name | abbreviation | name  
  ------+--------------------+------+--------------+-------
   Rice |                  1 | cup  |              | rice
   Rice |                  2 | cups |              | water
  </code></pre>
  
  <p>I can get the mapper to work when I take the collection out.
  I have tried using javaType and I have tried using the composite key in the collection, but it still didn't work. I have run out ideas and have looked in a ton of help posts but nothing stood out.</p>
  
  <p>I'm using Spring Boot with UTD versions of mybatis and mybatis-spring</p>