接口式編程:一對多關系
我使用接口式編程對“通過自動回復機器人學Mybatis---基礎版”中第5章的“一對多關系”進行修改,
<mapper namespace="com.imooc.dao.ICommand"> ?<!-- 現通過接口的完全限定名,來統一namespace -->
? <resultMap type="com.imooc.bean.Command" id="Command">
? ? <id column="C_ID" jdbcType="INTEGER" property="id"/>
? ? <result column="NAME" jdbcType="VARCHAR" property="name"/>
? ? <result column="DESCRIPTION" jdbcType="VARCHAR" property="description"/>
? ? <collection property="contentList" resultMap="CommandContent.Content"/>?
? </resultMap>
...
發現報錯:### Cause: java.lang.IllegalArgumentException: Result Maps collection does not contain value for CommandContent.Content
求教是什么原因
2015-02-08
額,原來與接口式編程沒關系,是我sql語句有問題...