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就行了。

发布了386 篇原创文章 · 获赞 19 · 访问量 82万+

猜你喜欢

转载自blog.csdn.net/watson243671/article/details/86482466