mybatis查询出错:
nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'tableName' in 'class java.lang.String'
出错原因
具体涉及代码:
mapper.xml
<!--检查表是否存在-->
<select id="checkIsTableExists" parameterType="String" resultType="Integer">
SELECT COUNT(*) as "countNum"
FROM USER_TABLES
WHERE TABLE_NAME = ${tableName}
</select>
Mapper类
/**
* 检查表是否存在
*
* @param tableName 表名
* @return 数量
*/
Integer checkIsTableExists(String tableName);
解决办法
修改代码:
/**
* 检查表是否存在
*
* @param tableName 表名
* @return 数量
*/
Integer checkIsTableExists(@Param(value = "tableName") String tableName);
参考:
最新评论
喵影视TV,目前,最好用的吧,没有广告
已经死了这个app
大哥 求求
一个人用就够,多人钱包伤不起啊