title: how do size JPA to Criteriaquery
body: <p>I have this Java code: </p>
  
  <pre><code>CriteriaBuilder qb = entityManager.getCriteriaBuilder(); 
  CriteriaQuery&lt;Long&gt; cq = qb.createQuery(Long.class);
  cq.select(qb.count(cq.from(MyEntity.class))); 
  cq.where(/*your stuff*/); 
  return entityManager.createQuery(cq).getSingleResult();
  </code></pre>
  
  <p>I would like to do this a criteria query:</p>
  
  <pre><code>SELECT COUNT(p),pa.nomPays FROM SessionPersonne s JOIN s.personne p , 
  p.entreprise e , e.adresse a , a.localite l , l.pays pa , s.session session 
  WHERE size(s.passageCollection)  &gt; 0   GROUP BY pa.nomPays
  </code></pre>
  
  <p>but how do <code>size(s.passageCollection)  &gt; 0</code> with the critical query ?</p>
  
  <p>Thanks you.</p>