title: How do I count the number of rows returned by subquery?
body: <p>I want to do something like this:</p>
  
  <pre><code>select count(*) from (select ...)
  </code></pre>
  
  <p>(As it would be in SQL), but in JPA.</p>
  
  <p>Any ideas on how I would do it?</p>