1.问题引入
MyBatis在配置mapper.xml映射文件中进行与对应的接口进行传递参数处出现了异常:
Exception in thread “main” org.apache.ibatis.exceptions.PersistenceException:
Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘xxx’ in ‘class java.lang.String’
Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘xxx’ in ‘class java.lang.String’
-
异常翻译:该异常就是说在String类中找不到属性xxx。常见的就是当接口和mapper.xml传递单个参数时用${}取值时;
-
制造异常:
dao接口中的方法定义:ArrayList<User> selectByName(String name);
Xxxmapper.xml映射配置文件中的sql:
<