Mybatis 传单个参数,xml中直接用#{id}表达式取值是不会有问题的。
但是用<if test="id != null">
去判断是否为空,这个时候就会报There is no getter异常。
解决方法:
在dao中,方法的参数加上@Param。
mybatis异常 There is no getter for property
最新推荐文章于 2024-03-11 11:24:08 发布
Mybatis 传单个参数,xml中直接用#{id}表达式取值是不会有问题的。
但是用<if test="id != null">
去判断是否为空,这个时候就会报There is no getter异常。
解决方法:
在dao中,方法的参数加上@Param。