MyBatis关联映射

关联映射

如果有存在多表关联result中出现名字一致,会出现争议问题argument type mismatch
如果关联property不在外表,会出现getter不到

Could not set property 'xx' of 'class com.xx.xxxxx.listC' with value 'com.xx.xxxxx.listResult@202e130a'


<association  property="listResult" javaType="com.listResult">
    <result column="warename" jdbcType="VARCHAR" property="warename" />
    <result column="history" jdbcType="VARCHAR" property="history" />
    <result column="address" jdbcType="VARCHAR" property="address" />
</association>

测试失败

<collection property="dictFixtureType" ofType="dictFixtureType">
    <result column="warename" jdbcType="VARCHAR" property="warename" />
    <collection property="warehouse" ofType="warehouse">
	    <result column="history" jdbcType="VARCHAR" property="history" />
	    <collection property="tiaoma" ofType="tiaoma">
			<result column="address" jdbcType="VARCHAR" property="address" />
		</collection>
	</collection>
</collection>

测试失败

<collection property="listResult" ofType="listResult">
    <result column="warename" jdbcType="VARCHAR" property="warename" />
    <result column="history" jdbcType="VARCHAR" property="history" />
    <result column="address" jdbcType="VARCHAR" property="address" />
</collection>
发布了26 篇原创文章 · 获赞 3 · 访问量 6433
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 技术黑板 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览