title: Return list of Object inside Object with MyBatis
body: <p>I encountered problems when returning a list of Objects inside another Object when using MyBatis. My main object looks like this:</p>
  
  <pre><code>private Long id;
  
  private String symbol;
  
  private List&lt;TypePermission&gt; typePermissions;
  </code></pre>
  
  <p>and my mapper looks like this </p>
  
  <pre><code>&lt;resultMap type="CalendarType" id="calendarTypeMap"&gt;
      &lt;result column="id" property="id"/&gt;
      &lt;result column="symbol" property="symbol"/&gt;
      &lt;collection property="TypePermissions" resultMap="TypePermissions"/&gt;
  &lt;/resultMap&gt;
  
  &lt;resultMap id="TypePermissions" type="TypePermission"&gt;
      &lt;result property="roleId" column="roleId"/&gt;
      &lt;result property="permissionSymbol" column="permissionSymbol"/&gt;
  &lt;/resultMap&gt;
  </code></pre>
  
  <p>My goal is to get an object like this:</p>
  
  <pre><code>content:[
      "id":id,
      "symbol":symbol,
      "TypePermissions":{
          "roleId":roleId,
          "permissionSymbol":permissionSymbol
      }
  ]
  </code></pre>
  
  <p>When I execute the sql query I get the following an error <code>cannot find symbol TypePermissions</code>, because the main SELECT tries to select rows such as TYPEPERMISSIONS, ID, SYMBOL</p>
  
  <p>I searched over the internet, but failed to find anything useful. Could you help me and point out what am I doing wrong?</p>