@Override
    public List<ExplorerTreeNode> getPath(final ExplorerTreeNode node) {
        return JooqUtil.contextResult(explorerDbConnProvider, context ->
                        context
                                .select(n.ID, n.TYPE, n.UUID, n.NAME, n.TAGS, p.DEPTH)
                                .from(n.innerJoin(p).on(n.ID.eq(p.ANCESTOR)))
                                .where(p.DESCENDANT.eq(node.getId()).and(p.ANCESTOR.ne(node.getId())))
                                .orderBy(p.DEPTH.desc())
                                .fetch())
                .map(r ->
                        new ExplorerTreeNode(r.get(n.ID),
                                r.get(n.TYPE),
                                r.get(n.UUID),
                                r.get(n.NAME),
                                NodeTagSerialiser.deserialise(r.get(n.TAGS))));
    }
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