title: Could not set parameters for mapping in Mybatis when using Springboot framework
body: <p>I am a new starter of Java web and I have tried many ways in Stack Overflow to solve the problem but failed. Could you help me?</p>
  <p>The interface in my code is:</p>
  <pre class="lang-java prettyprint-override"><code>public List&lt;Answer&gt; selectAnswerByUser(@Param(&quot;user&quot;) User user,  @Param(&quot;id&quot;) Integer id);
  </code></pre>
  <p>where <code>Answer</code> and <code>User</code> are two classes I have defined.</p>
  <p>The Mapper is:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;select id=&quot;selectAnswerByUser&quot; parameterType=&quot;java.util.Map&quot; resultType=&quot;Answer&quot;&gt;
      select * from answer where exercise_id=#{id} and user_email='#{user.email}'
  &lt;/select&gt;
  </code></pre>
  <p>where email is a variable of Class User.</p>
  <p>And it throws:</p>
  <pre><code>nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='user.email', mode=IN, javaType=class java.lang.Object, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. 
  Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #2 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. 
  Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #2 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. 
  Cause: java.sql.SQLException: Parameter index out of range (2 &gt; number of parameters, which is 1).
  </code></pre>
  <p>I have no idea about the exception.</p>