How to do setProjection in 5.2.17

I original query is
(Long) this.getCurrentSession().createCriteria(this.entitySet.getName())
.setProjection(Projections.rowCount()).uniqueResult();
now createCriteria is deprecated, so how can I do something similar to setProjection(Projections.rowCount()?

thanks

Just the same for Hibernate Criteria. For JPA Criteria, check out the User Guide.