\r
query.exec("Update tag set parentguid=null where parentguid not in (select distinct guid from tag);"); \r
}\r
+\r
+ \r
+ public List<String> findChildren(String guid, List<Tag> tagList) {\r
+ List<String> returnValue = new ArrayList<String>();\r
+ \r
+ for (int i=0; i<tagList.size(); i++) {\r
+ if (tagList.get(i).getParentGuid().equalsIgnoreCase(guid)) {\r
+ returnValue.add(tagList.get(i).getName());\r
+ List<String> childMatch = findChildren(tagList.get(i).getGuid(), tagList);\r
+ for (int j=0; j<childMatch.size(); j++) {\r
+ returnValue.add(childMatch.get(j));\r
+ }\r
+ }\r
+ }\r
+ return returnValue;\r
+ }\r
}\r