@Override
    public List<ExplorerTreeNode> getChildren(final ExplorerTreeNode parent) {
        return JooqUtil.contextResult(explorerDbConnProvider, context -> context
                        .selectFrom(n)
                        .where(n.ID.in(context
                                .select(p.DESCENDANT)
                                .from(p)
                                .where(p.ANCESTOR.eq(parent.getId()))
                                .and(p.DEPTH.eq(1))
                                .orderBy(p.ORDER_INDEX)))
                        .fetch())
                .map(this::mapRecord);
    }
Get the root node containing a particular node, or the node itself if it is a root node.
stroom-explorer/stroom-explorer-impl-db/src/main/java/stroom/explorer/impl/db/ExplorerTreeDaoImpl.java