.setHint("org.hibernate.comment", "Querying children of wiki node: " + parentNodeId)
.setParameter("parentNodeId", parentNodeId)
.setParameter("readAccessLevel", Component.getInstance("currentAccessLevel"))
.getResultList();
for (WikiNode node : nodes) {
tree.add(new WikiTreeNode(currentLevel, node));
if (maxDepth == null || currentLevel < maxDepth) {
if (flattenToLevel == null || currentLevel < flattenToLevel) {
currentLevel++;
appendWikiNodeChildren(query, tree, node.getId(), currentLevel, maxDepth, flattenToLevel);
currentLevel--;