mybatis报错:
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'class java.lang.Long'
xml中,sql如下:
select
dd.*
from
sys_mouldtype_device md,
sys_dict_data dd,
sys_device d
where
md.mouldtype_code = dd.dict_code
and md.device_id = d.id
<if test="id != null"> and d.id = #{id}</if>
将“id != null”改成“_parameter != null”就可以了。

本文介绍了一个关于MyBatis查询时出现的错误:在Java.lang.Long类中找不到名为'id'的getter方法。通过调整XML文件中的条件判断表达式,从'id!=null'改为'_parameter!=null'解决了这一问题。
3619

被折叠的 条评论
为什么被折叠?



