How to get Row Count with JQL?

.. in JPA!

Here is how, enjoy..
final Criteria criteria = getCurrentSession().createCriteria(TargetEntity.class);
criteria.add(Restrictions.eq(fieldName, entity));
criteria.setProjection(Projections.rowCount());
return (Number) criteria.uniqueResult();