java - MyBatis association error -
i have 3 objects: a, b , c. contains b , b contains c. need load atributtes three. bellow select: can load , b, when seek load c (bold lines), next error:
"java.lang.runtimeexception: error parsing mapper xml. cause: java.lang.illegalargumentexception: result maps collection contains value b"
any thought how can prepare this?
i'm using mybatis 3.1.1 spring , maven
<select id="loada" resultmap="aresult"> select * a, b b, c c a.lae_ree_cod=b.ree_cod , 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>** java spring mybatis
No comments:
Post a Comment