title: JPA criteria query + self join on rowid
body: <p>I'm trying to write JPA criteria query.</p>
  
  <pre><code>Select * from classA t1 
  inner join
  
    (SELECT rowid
       FROM classA 
        where  conditions...
        ORDER BY clause
     )t2 
   on t1.rowid = t2.rowid
  
  ORDER BY clause
  where  rownum &lt;= 500
  </code></pre>
  
  <p>I'm having problems in joining the main criteria query with inner criteria query(with predicates)? .Is there a possibilty to do join on criteria queries(not on roots)?</p>
  
  <p>Any help is much appreciated.
  note:domain class already having composite PK- annoted with embeddedId.</p>