mybatis关联查询为什么会出现无限循环的结果,急!!!
<resultMap id="BaseResultMap" type="com.jeeplus.modules.sys.entity.ldMenu" >
<id column="NODECODE" property="nodecode" jdbcType="VARCHAR" />
<result column="NODELEVEL" property="nodelevel" jdbcType="VARCHAR" />
<result column="NODENAME" property="nodename" jdbcType="VARCHAR" />
<result column="CHILDFLAG" property="childflag" jdbcType="VARCHAR" />
<result column="NODEKEY" property="nodekey" jdbcType="VARCHAR" />
<result column="RUNSCRIPT" property="runscript" jdbcType="VARCHAR" />
<result column="NODEDESCRIPTION" property="nodedescription" jdbcType="VARCHAR" />
<result column="NODESIGN" property="nodesign" jdbcType="VARCHAR" />
<result column="NODEORDER" property="nodeorder" jdbcType="DECIMAL" />
<result column="STATUS" property="status" jdbcType="VARCHAR" />
<result column="OPERATOR" property="operator" jdbcType="VARCHAR" />
<result column="MAKEDATE" property="makedate" jdbcType="DATE" />
<result column="MAKETIME" property="maketime" jdbcType="VARCHAR" />
<result column="MODIFYDATE" property="modifydate" jdbcType="DATE" />
<result column="MODIFYTIME" property="modifytime" jdbcType="VARCHAR" />
<result column="IS_SHOW" property="isShow" jdbcType="CHAR"/>
<result column="PERMISSION" property="permission" jdbcType="VARCHAR"/>
<!-- 查询父模块-->
<association property="parent" column="PARENTNODECODE" select="getParent" />
<!-- 查询子模块 -->
<collection property="children" column="NODECODE" select="getChildren" />
</resultMap>
<sql id="Base_Column_List" >
a.NODECODE, a.PARENTNODECODE AS "parent.nodecode", a.NODELEVEL, a.NODENAME, a.CHILDFLAG, a.NODEKEY, a.RUNSCRIPT, a.NODEDESCRIPTION,
a.NODESIGN, a.NODEORDER, a.STATUS, a.OPERATOR, a.MAKEDATE, a.MAKETIME, a.MODIFYDATE, a.MODIFYTIME,p.name AS "parent.name"
</sql>
<sql id="menuJoins">
LEFT JOIN TBL_LDMENU p ON p.nodecode = a.PARENTNODECODE
</sql>
<!-- 根据父id查询所有父菜单 -->
<select id="getChildren" parameterType="String" resultMap="BaseResultMap">
select * from TBL_LDMENU where PARENTNODECODE = #{nodecode} order by nodeorder
</select>
<!-- 根据id查询所有的菜单 -->
<select id="getParent" parameterType="String" resultMap="BaseResultMap">
select * from TBL_LDMENU where nodecode = #{nodecode}
</select>