title: Recursively query column using JPA to find descendants of an object
body: <p>Let's say I have a table called Person with the columns:</p>
  
  <pre><code>id, name, parent_id
  </code></pre>
  
  <p>and let's say I have some data like this:</p>
  
  <pre><code>1, Bob, null
  2, Mary, 1
  3, Tim, 1
  4, Sally, 3
  </code></pre>
  
  <p>So Bob has 2 kids: Mary and Tim.
  And Tim has 1 kid: Sally (who grandparent is Bob)</p>
  
  <p>What is the easiest way to write a JPA query such that I could find all descendants of Bob? (i.e. the result would return Mary, Tim and Sally) </p>