Criteria API limit results in subquery
<p>I'm trying to write a query similar to</p>

<pre><code>select * from Table a
 where a.parent_id in 
  (select b.id from Table b
   where b.state_cd = ?
   and rownum &lt; 100)
</code></pre>

<p>using the <a href="http://docs.oracle.com/javaee/6/tutorial/doc/gjitv.html" rel="noreferrer">Criteria API</a>. I can achieve the query without the rownum limitation on the subquery fine using similar code to <a href="https://stackoverflow.com/a/4668015/597419">https://stackoverflow.com/a/4668015/597419</a> but I cannot seem to figure out how to appose a limit on the <a href="https://docs.oracle.com/javaee/6/api/javax/persistence/criteria/Subquery.html" rel="noreferrer"><code>Subquery</code></a></p>