安装文档中的说法:
mybatis tips - association中使用selectByPrimaryKey

但是在实际中,遇到了如下问题:

  select There is no setter for property named in java.lang.String

解决方案

<resultMap id="BaseResultMap" ...
	    <association property="expert" column="EXPER_ID" select="com.xx.domain.xxx.selectByPrimaryKey" />

selectByPrimaryKey中,column直接添加ID就行了。

相关文章: