title: MyBatis Insert and Return Key - Annotations/Primatives/MySql
body: <p>I've got a bit of a corner case here. I'm wanting to insert into a MySql table with MyBatis configured via annotations and return the auto-increment key. My method is only using primitives though, not a POJO:</p>
  
  <pre><code>@Insert("INSERT into my_list (created_by_id, name) values (#{userId}, #{name})")
  @Options(useGeneratedKeys=true)
  long insert(@Param("userId") long userId, @Param("name") String name); 
  </code></pre>
  
  <p>How do I tell MyBatis to map the key back to the method return parameter (rather than a POJO member variable)?</p>
  
  <p>I'm getting the exception:</p>
  
  <pre><code>org.mybatis.spring.MyBatisSystemException: nested exception is
  org.apache.ibatis.executor.ExecutorException: Error getting generated key or setting 
  result to parameter object. 
  Cause: org.apache.ibatis.binding.BindingException: Parameter 'id' not found. Available 
  parameters are [userId, name, param1, param2]
  </code></pre>