There is no getter for property named 'user' in 'class com.jyr.wh.domain.User' 异常(示例
Posted skyxia
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了There is no getter for property named 'user' in 'class com.jyr.wh.domain.User' 异常(示例相关的知识,希望对你有一定的参考价值。
今天在使用mybatis时,出现了一个问题:There is no getter for property named ‘user‘ in ‘class com.jyr.wh.domain.User,现记录下来
使用注解的形式写sql语名,参数为一个对象
以下为正确写法:
@Insert( |
import java.io.Serializable; |
报错找不到user那是因为我的sql写错了,在values的参数中加了形参
@Insert( |
在使用注解方式时形参不用写,只写传的对象的属性即可,加上会报以上错误。
~~~~~~~~~~ 完 ~~~~~~~~~~~~
以上是关于There is no getter for property named 'user' in 'class com.jyr.wh.domain.User' 异常(示例的主要内容,如果未能解决你的问题,请参考以下文章