问题描述
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEsqlMapPUBLIC"-//iBATIS.com//DTDSQLMap2.0//EN""http://www.ibatis.com/dtd/sql-map-2.dtd"><sqlMapnamespace="test.module1"><resultMapid="MenuBean"class="com.bonc.xframe.web.xframe.security.MenuBean"><resultproperty="MODULE_ID"column="MODULE_ID"></result><resultproperty="PARENT_ID"column="PARENT_ID"></result><resultproperty="MODULE_NAME"column="MODULE_NAME"></result><resultproperty="URL"column="URL"></result><resultproperty="LOGIN_ID"column="LOGIN_ID"></result><resultproperty="mList"column="{a=MODULE_ID,b=LOGIN_ID}"select="test.module1.getSubMenuBean"></result></resultMap><selectid="getMenuBean"resultMap="MenuBean">selectMODULE_ID,PARENT_ID,MODULE_NAME,URL,#LOGIN_ID#LOGIN_IDfromsc_menuwherePARENT_ID=#PARENT_ID#</select><selectid="getSubMenuBean"resultMap="MenuBean">SELECTF.MODULE_IDMODULE_ID,F.PARENT_IDPARENT_ID,F.MODULE_NAMEMODULE_NAME,F.URLURL,#LOGIN_ID#LOGIN_IDFROMVIEW_SC_MODULE_INFOF,(SELECTC.MODULE_IDFROMSC_USER_PERMISSIONSCWHEREC.LOGIN_ID=#b#AND(C.AUTH_READ=1ORC.AUTH_CREATE=1ORC.AUTH_UPDATE=1ORC.AUTH_DELETE=1)UNIONSELECTD.MODULE_IDFROMSC_ROLE_PERMISSIONSD,SC_ROLE_USERSWHERED.ROLE_ID=S.ROLE_IDANDS.LOGIN_ID=#b#AND(D.AUTH_READ=1ORD.AUTH_CREATE=1ORD.AUTH_UPDATE=1ORD.AUTH_DELETE=1))F2WHEREF.MODULE_ID=F2.MODULE_IDandf.PARENT_ID=#a#ORDERBYF.ORD</select></sqlMap>
“getMenuBean”为入口,“getSubMenuBean”为mList自动装载的sql。我的问题是,这样写不能无限的自动装载,自能装载一层。怎么解决
解决方案
解决方案二:
添加remapResults="true"这个行吗