惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
J
Java Code Geeks
有赞技术团队
有赞技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
Apple Machine Learning Research
Apple Machine Learning Research
量子位
D
Docker
V
Visual Studio Blog
博客园 - 司徒正美
Martin Fowler
Martin Fowler
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学
U
Unit 42
M
MIT News - Artificial intelligence
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
V
V2EX
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网
Vercel News
Vercel News
C
Check Point Blog

博客园 - 笑笑江南

sss IBATIS 延迟加载 [转]office outlook 2007 如何设置开机自动启动 代码整洁之道 类关系 eclipse 快捷键 9-15 企业数据更新 mysql 常用函数 利用myeclipse生成Hibernate Mapping文件【转】 配置eclipse下tomcat启动参数【转】 安装svneclipse .net 开发相关工具(包)的作用 basicform 与 store gridpanel中拖拽排序 struts2 file 标签产生的一个问题 使用 ajax 提交数据 applyTo ,render, contentel,el,applytomarkup 的区别 呕吐呕吐 tabpanel 添加 tab
iBATIS一对多/多对多N+1问题解决方案 - 笑笑江南 - 博客园
笑笑江南 · 2010-08-19 · via 博客园 - 笑笑江南

   XML

<resultMap id="sub-menu-map" class="menu">  
        <result property="id" column="subid" />  
        <result property="name" column="subname" />   
</resultMap>   
<resultMap id="menu-map" class="menu" groupBy="id">  
        <result property="id" column="id" />  
        <result property="name" column="name" />   
        <result property="subMenus" resultMap="sys.sub-menu-map" />   
</resultMap>  

SQL

select     t.*  from menu t left join menu s   
    on t.id = s.parentid    
where t.layer=1 order by t.position, s.position