Mybatis-no getter for property named 'col_name' in 'class com.xxx.onebean'

Mybatis中出现该异常

There is no getter for property named ‘col_name’ in ‘class com.xxx.onebean

意思是onebean这个实体中没有变量col_name的getter方法。这种情况可能使:

1.真的没有加getter方法

2.entityMapper.xml中应该使用#{实体类变量名},而不是#{数据库列名}。

点赞

Leave a Reply

Your email address will not be published. Required fields are marked *