1 List<Category> srclist=CategoryDao.findList(); 2 List<Category> targetlist=new ArrayList<Category>(); 3 turnToTree(srclist,targetlist,null);
注:sql语句查询出来的数据是按1,2,3级顺序排列的
递归list转成tree
原文:http://www.cnblogs.com/wbing168/p/4748604.html