title: cte sql to simple subset query for JPA
body: <p>How can we change below CTE query (recursive) to simple subset sql:</p>
  
  <pre><code>  WITH links (parent, child) AS
    ( SELECT parent, child
          FROM Heirarchy_Table
          WHERE parent = '111111'
     UNION ALL 
      SELECT ht.parent, ht.child
          FROM Heirarchy_Table ht
          INNER JOIN links ON links.child = ht.parent)
  SELECT * FROM links fl;
  </code></pre>
  
  <p>I need to use this query for JPA as JPA is not handling "WITH" clause.
  [Note: "links" cte is used recursively].
  Many Thanks!!</p>