title: MyBatis Insert and no return key :Error getting generated key or setting result to parameter object
body: <p>I am getting exception while inserting a record in to a table using with MyBatis (MyBatis-3.1.1jar)configured via annotations.</p>
  
  <p>Well the table has only two columns.</p>
  
  <pre><code>Table EMLSIGNUP(
  employeeName varchar(25)
  country varchar(25)
  )
  </code></pre>
  
  <p>And I am using POJO class to insert records.</p>
  
  <pre><code>public class EmailBean{
  private String employeeName;
  private String country;
  …getters and setters..
  }
  </code></pre>
  
  <p>And In the mapper I am inserting like this.</p>
  
  <pre><code>@Insert("INSERT INTO EMLSIGNUP(employeeName,COUNTRY, ) " +
          "VALUES (#{employeeName  ,jdbcType=VARCHAR},  #{country ,jdbcType=VARCHAR})")
  public void insertEmail(EmailBean emailBean);
  </code></pre>
  
  <p>The exception is </p>
  
  <pre><code>caused by: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Error getting generated key or setting result to parameter object. Cause: java.lang.NullPointerException
  </code></pre>
  
  <p>Seems it’s looking for some primary key, which I have not defined in the database as well as in the POJO class and </p>
  
  <p>Since its audit table we don’t want any primary key to be there in the table as user login to our application we store his name and country visited.</p>