title: How to implement `connect by prior` in hibernate?
body: <p>This is my query in oracle, but i want to implement it with hibernate as a <code>Generic</code> function that will be use in entire of application. then i googled it and realized that hibernate does not support this type of queries.</p>
  
  <pre><code>--query in pl/sql
  select *
  from myTable t
  start with t.id = 1
  connect by prior t.id = t.parentid
  
  
  public class MyModel {
      Integer id;
      MyModel parent;
  
      // getter and setters
  }
  
  // suggested method signature
  public &lt;T&gt; List&lt;T&gt; getByPrior(Integer startId) {
      //return;
  }
  
  // and call it as you seen below
  MyModel.getByPrior(1);
  </code></pre>
  
  <p><strong>NOTE</strong></p>
  
  <ol>
  <li>I don't want to use named queries.</li>
  <li>I'm beginner to hibernate</li>
  </ol>