title: Extending MyBatis Mapper interface can result in exception
body: <p>I extended a MyBatis Mapper in order to take advantage of Java 8 lambda functions like this:</p>
  
  <pre><code>public interface MyTableMapper extends IBatchInsertUpdateMapper&lt;MyTable&gt; {...}
  public interface IBatchInsertUpdateMapper&lt;T&gt; extends IBatchInsertMapper&lt;T&gt;, IBatchUpdateMapper&lt;T&gt; {}
  public interface IBatchInsertMapper&lt;T&gt; { public int insert(T record); }
  public interface IBatchUpdateMapper&lt;T&gt; { public int updateByPrimaryKey(T record); }
  </code></pre>
  
  <p>Interestingly, when I run the code under Tomcat7, the Eclipsed compiled code runs fine, but with Maven compiled code, I get:</p>
  
  <pre><code>java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.xxx.mybatis.mapper.MyTableMapper.selectByPrimaryKey
       at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:660)
       at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:495)
       at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:488)
       at org.apache.ibatis.binding.MapperMethod.setupCommandType(MapperMethod.java:236)
       at org.apache.ibatis.binding.MapperMethod.&lt;init&gt;(MapperMethod.java:71)
       at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:39)
       at com.sun.proxy.$Proxy52.selectByPrimaryKey(Unknown Source)
       ...
  </code></pre>
  
  <p>It seems that ibatis can find the insert() and updateByPrimaryKey() methods but can't find other methods in the MyTableMapper interface.</p>
  
  <p>Any idea why?</p>
  
  <p>FYI, I'm using:</p>
  
  <ul>
  <li>jdk1.8.0_66</li>
  <li>build-helper-maven-plugin: 1.7</li>
  <li>maven-enforcer-plugin: 1.3.1</li>
  </ul>
  
  <p>Maven is compiling with 1.8.0_66:</p>
  
  <pre><code>Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T17:37:52+00:00)
  Maven home: C:\Users\Me\workspaceLunaSr2\Dev\EMBEDDED
  Java version: 1.8.0_66, vendor: Oracle Corporation
  Java home: C:\Program Files\Java\jdk1.8.0_66\jre
  Default locale: en_GB, platform encoding: Cp1252
  OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
  </code></pre>
  
  <p>Similarly, Eclipse is reporting that I'm using 1.8.0_66:</p>
  
  <pre><code>java.endorsed.dirs=C:\Program Files\Java\jre1.8.0_66\lib\endorsed
  java.ext.dirs=C:\Program Files\Java\jre1.8.0_66\lib\ext;C:\Windows\Sun\Java\lib\ext
  java.home=C:\Program Files\Java\jre1.8.0_66
  </code></pre>
  
  <p>In case you're wondering, the reason behind all this is because I found MyBatis batch insert using</p>
  
  <pre><code>&lt;foreach&gt;...&lt;/foreach&gt;
  </code></pre>
  
  <p>very inefficient. A much more efficient way was presented here: <a href="https://stackoverflow.com/questions/23486547/mybatis-batch-insert-update-for-oracle">MyBatis Batch Insert/Update For Oracle</a>, and with the help of lambda functions, I only need to write one method to do batch insert/update/etc.</p>