关于mybatis参数问题说明
规则: mybatis如果遇到多值传参时,默认条件是采用下标的方式获取数据.
mybatis天生只支持单值传参,如果遇到多值的问题,则应该将多值封装为单值.
BindingException异常说明
异常一:
org.apache.ibatis.binding.BindingException: Type interface com.jt.mapper.UserMapper is not known to the MapperRegistry.
解决方案1:
检查namespace命名是否与接口一致
异常二
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.jt.mapper.UserMapper.findAll
解决方案2:
检查xml映射文件中的ID是否与接口方法一致.
异常三:
The error may exist in mybatis/mappers/UserMapper2.xml
解决方案3:
检查mybatis核心文件加载mapper映射文件的路径是否正确.
异常四:
It's likely that neither a Result Type nor a Result Map was specified
检查 xml配置文件中的resultType是否正确