title: Mybatis foreach collection is a list in a map-parameter
body: <p>I'm using mybatis 3.2.8 version.</p>
  
  <p>Mapper.java</p>
  
  <pre><code>List&lt;BuddyId&gt; findBuddyIds(HashMap&lt;String, Object&gt; map);
  </code></pre>
  
  <p>xml</p>
  
  <pre><code>&lt;select id="findBuddyIds" parameterType="map" resultMap="BuddyIdResultMap"&gt;
  select * 
  from seerid.buddyIds
  where id REGEXP
  &lt;foreach collection="idSplits" item="item" index="index" open="'" close="'" separator="|"&gt;
      #{item}
  &lt;/foreach&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>Controller.java</p>
  
  <pre><code>HashMap&lt;String,Object&gt; map = new HashMap&lt;String,Object&gt;();
  
  map.put("idSplits", new ArrayList&lt;String&gt;(Arrays.asList(idSplits)));
  
  buddyScanResult = seerIdDAO.findBuddyIds(map);
  </code></pre>
  
  <p>It will receive the following error.</p>
  
  <blockquote>
    <h3>Error querying database.  Cause: java.sql.SQLException: Could not set parameter</h3>
    
    <h3>The error may exist in file [/Users/jylee/Documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/services/WEB-INF/classes/com/ohinc/services/seerid/mybatis/SeerIdMapper.xml]</h3>
    
    <h3>The error may involve com.ohinc.services.seerid.mybatis.SeerIdMapper.findBuddyIds-Inline</h3>
    
    <h3>The error occurred while setting parameters</h3>
    
    <h3>SQL: select *   from seerid.buddyIds  where id REGEXP   '     ?   |    ?   '</h3>
    
    <h3>Cause: java.sql.SQLException: Could not set parameter ; uncategorized SQLException for SQL []; SQL state [null]; error code</h3>
    
    <p>[0]; Could not set parameter; nested exception is
    java.sql.SQLException: Could not set parameter] with root cause
    org.mariadb.jdbc.internal.common.query.IllegalParameterException: No
    '?' on that position  at
    org.mariadb.jdbc.internal.common.query.MySQLParameterizedQuery.setParameter(MySQLParameterizedQuery.java:103)</p>
  </blockquote>
  
  <p>I don't know how to solve this problem.</p>
  
  <p>Please help me.</p>