java接口方法:
public int getCount(ProjectCriteria criteria);
ProjectCriteria类:
public class ProjectCriteria implements Criteria{
private String name;
xml配置:
<select id="getCount" parameterType="ProjectCriteria" resultType="int">
select count(1) from project
where `name` like '%#{name,jdbcType=INTEGER}%'
</select>
junit报错:
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping{property='name', mode=IN, javaType=class java.lang.String, jdbcType=INTEGER, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #1 with JdbcType INTEGER . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
配置什么的都没问题,其他项目也这样用,同一个项目中insert,update方法都好着呢,就select这个方法里边不能用,不知道为什么