private boolean exists(final ExplorerTreeNode node) {
        return JooqUtil.contextResult(explorerDbConnProvider, context ->
                context
                        .selectCount()
                        .from(p)
                        .where(p.DESCENDANT.eq(node.getId()))
                        .fetchOne(0, int.class)) > 0;
    }
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