title: Mybatis 3.0.5 insert/update statement mapping with multiple inputs
body: <p>Maybe I am missing something obvious, but I cannot get a simple mapped insert statement executing successfully.</p>
  
  <p>Using the following interface</p>
  
  <pre><code>public interface CustomItemMapper 
  {
      Integer insert(CustomItem item, @Param("extra") String someparam);
  }
  </code></pre>
  
  <p>and the following XML mapping</p>
  
  <pre><code>  &lt;insert id="insert" useGeneratedKeys="false" parameterType="map" keyProperty="id"&gt;
      insert into CustomItem (id, column2, column3, column4, column5, column6)
          values (#{id}, #{field2}, #{field3}, #{field4}, #{field5}, #{extra})
    &lt;/insert&gt;
  </code></pre>
  
  <p>and this code</p>
  
  <pre><code>SqlSessionFactory sqlSessionFactory = (SqlSessionFactory) servletContext.getAttribute("SqlSessionFactory");
  SqlSession session = sqlSessionFactory.openSession();
  try 
  { 
      CustomItemMapper mapper = session.getMapper(CustomItemMapper.class); 
      mapper.update(item);
      session.commit();
  } 
  finally 
  { 
      session.close(); 
  } 
  </code></pre>
  
  <p>I get the following debug output:</p>
  
  <pre><code>Checked out connection 368716606 from pool.
  ooo Connection Opened
  ==&gt;  Executing: insert into CustomItem (id, column2, column3, column4, column5, column6) values (?, ?, ?, ?, ?, ?) 
  ==&gt; Parameters: null, null, null, null, null, actual_value_of_extra(String)
  xxx Connection Closed
  Returned connection 368716606 to pool.
  </code></pre>
  
  <p>followed by the SQL exception (cannot enter null into the <code>id</code> column).</p>
  
  <p>So the only value that was passed in properly is the extra supplied string. I have verified that the field names are correct and object is not null at this point and the fields are populated properly.</p>
  
  <p>I also tried using <code>parameterType="CustomItem"</code> instead of <code>parameterType="map"</code> but the result did not change.</p>
  
  <p>I would appreciate if someone could let me know what I am missing here.</p>
  
  <p>Thanks in advance.</p>
  
  <p>PS: I get into the same problem with insert statements, as well.</p>