mybatis使用动态sql时报错:There is no getter for property named '*' in 'class java.lang.String

原创 2016年08月31日 14:03:35

mybatis使用动态sql:如<if><when><trim><where>,而parameterType又恰好是string,

如下:


<select id="getP_VListWithParams" parameterType="string" resultMap="p_vMap">
       		select * from p_v 
       		 <where>
	            <if test="<span style="background-color: rgb(51, 204, 0);"><strong><span style="font-size:24px;">p_v_id</span></strong></span>!= null">
	                locate (#{p_v_id},p_v_id)
	            </if>
            </where>
 </select>

此时,如果程序调用到getP_VListWithParams方法,则会报错:There is no getter for property named '*' in 'class java.lang.String


临时性的解决方案,把<if>检测语句中的p_v_id替换成_parameter,即:

<span style="background-color: rgb(240, 240, 240);"><select id="getP_VListWithParams" parameterType="string" resultMap="p_vMap">
       		select * from p_v 
       		 <where>
	            <if test="</span><span style="font-size:24px;"><strong><span style="background-color: rgb(0, 153, 0);">_parameter</span><span style="color:#33cc00;background-color: rgb(240, 240, 240);"> </span></strong></span><span style="background-color: rgb(240, 240, 240);">!= null">
	                locate (#{p_v_id},p_v_id)
	            </if>
            </where>
    </select></span>


即可解决上述报错,根本原因,请参考blog:

http://blog.csdn.net/qing_gee/article/details/47122227


源码分析 There is no getter for property named '*' in 'class java.lang.String

There is no getter for property named '*' in 'class java.lang.String',此错误之所以出现,是因为mybatis在对parameter...
  • qing_gee
  • qing_gee
  • 2015年12月25日 12:36
  • 23731

MyBatisSystemException There is no getter for property named 'id' in 'class java.lang.String'

具体错误信息如下: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflecti...

There is no getter for property named 'X' in 'class java.lang.XX'

UserDao.java代码如下: package soc.dao; import java.util.List; import java.util.Map; import org.apache....

关于myBatis的问题There is no getter for property named 'USER_NAME' in 'class com.bky.model.实例类'

现在流行的 ssm(spring + struts2 + myBatis)  持久层的mybatis是需要配置映射器的,找了个demo连接的数据库是mysql 于是就修改了一下弄成了连接oracle的...

Mybatis-异常-There is no getter for property named 'VARCHAR' in 'class com.xxx.xxxxx

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.Reflecti...
  • doegoo
  • doegoo
  • 2016年01月15日 15:00
  • 3179

There is no getter for property named 'value' in 'class com.hl.myabtis.first.beas.User'

There is no getter for property named ‘value’ in ‘class com.hl.myabtis.first.beas.User’异常...

使用MyBatis数组参数出现异常There is no getter for property named '__frch_customId_0'

实体中数组字段作为参数时,出现异常There is no getter for property named '__frch_customId_0' in 'class com.llg.modules...

Mybatis单个参数的if判断(针对异常:There is no getter for property..)

There is no getter for property named 'langId' in 'class java.lang.Integer' Mybatis异常处理

Mybatis单个参数的if判断(针对异常:There is no getter for property..)

我们都知道mybatis在进行参数判断的时候,直接可以用 就可以了,如下: 1、常规代码 update t_test_l trnsct_way_i...

com.ibatis.common.beans.ProbeException: There is no READABLE property named 'baiduIndex' in class 'j

第一次使用ibatis,不是很熟悉,使用时sql报如下错误: DEBUG 2016-04-18 10:45:41: [org.springframework.jdbc.support.SQLErr...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:mybatis使用动态sql时报错:There is no getter for property named '*' in 'class java.lang.String
举报原因:
原因补充:

(最多只允许输入30个字)