Relationship bTreeRel = underlyingNode.getSingleRelationship(
BTree.RelTypes.TREE_ROOT,
Direction.OUTGOING );
if ( bTreeRel != null )
{
bTree = new BTree( graphDb, bTreeRel.getEndNode() );
}
else
{
Node bTreeNode = graphDb.createNode();
underlyingNode.createRelationshipTo( bTreeNode,
BTree.RelTypes.TREE_ROOT );
bTree = new BTree( graphDb, bTreeNode );
}
tx.success();
}
finally
{