【发布时间】:2012-10-25 05:49:26
【问题描述】:
我想从 SQL 表中读取分层方式的项目。例如我的桌子有亲子关系。 以下是我的表结构:
id name parentId
1 abc null
2 xyz 1
3 lmn 1
4 qwe null
5 asd 4
所以我想一次性分层加载所有项目,我该怎么做? 我试过HashMap,但感觉很复杂...... 提前谢谢...
【问题讨论】:
-
你应该阅读 SELF JOINs
标签: java mysql structure parent-child hierarchy