我有三个对象:A,B和C. A包含B,B包含C. 我需要从这三个中加载一些atributtes。贝娄是我的选择: 我可以成功加载A和B,但是当我尝试加载C(粗线)时,我收到以下错误:
" java.lang.RuntimeException:解析Mapper XML时出错。原因:java.lang.IllegalArgumentException:Result Maps集合已包含B"
的值知道如何解决这个问题吗?
我在Spring和Maven中使用MyBatis 3.1.1
<select id="loadA" resultMap="AResult">
SELECT * FROM A a, B b, C c
where a.lae_ree_cod=b.ree_cod
and b.ree_rea_cod=c.rea_cod
</select>
<resultMap id="AResult" type="A">
<id property="A_Cod" column="cod" />
<result property="A_Descricao" column="descricao"/>
<result property="A_DataInclusao" column="datainclusao"/>
<association property="B_Executada" resultMap="BResult" />
</resultMap>
<resultMap id="BResult" type="B">
<id property="B_cod" column="cod"/>
<result property="B_voltou" column="voltou"/>
**<association property="C_Executada" resultMap="CResult" />**
</resultMap>
**<resultMap id="CResult" type="C">
<id property="C_cod" column="cod"/>
</resultMap>**