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中应该使用#{实体类变量名},而不是#{数据库列名}。

原文地址:https://www.cnblogs.com/aeolian/p/8444511.html