There is no getter for property named ‘name‘ in ‘class java.lang.String‘
程序员文章站
2022-07-15 16:16:13
...
在使用mybatis时出现了这种错误,这是因为我在sql语句中进行了判断:
@Select({"<script> " +
"SELECT a.*,b.img_url,b.name FROM floor_item a INNER JOIN banner b ON a.action_id = b.id " +
"<if test='name!=null and name!=\"\"'>where b.name = #{name}</if> " +
"</script>"})
而我在传参的时候是这样传的:
List<FloorItem> getFloorItem(String name);
只需要加上@Param参数就可以了:
List<FloorItem> getFloorItem(@Param("name") String name);
推荐阅读
-
There is no getter for property named ‘pCode‘ in ‘classXXX‘
-
There is no getter for property named ‘name‘ in ‘class java.lang.String‘
-
There is no getter for property named ‘name‘ in ‘class java.lang.String
-
Mybatis报错:There is no getter for property named ‘xxxx‘ in ‘class xxxx
-
Mybatis报错:There is no getter for property named 'xxxx' in 'class xxxx
-
Mybatis报错:There is no getter for property named ‘xxxx‘ in ‘class xxxx
-
Mybatis报错:There is no getter for property named ‘xxxx‘ in ‘class xxxx
-
There is no getter for property named 'xxx' in 'class java.lang.xxxx'解决办法
-
Mybatis There is no getter for property named 'xxxx' in 'class java.lang.String'
-
There is no getter for property named 'xxx' in 'class com.ams.ams.entity.xxx'