List<T> partialList = query.setMaxResults(currentPage.getElements())
.setFirstResult(currentPage.getStartingElement()).list();
Query countQuery = session.createQuery(countString);
PagerQueryImpl queryImpl = new PagerQueryImpl((SessionImplementor) session,(QueryImpl)query);
Map<String, TypedValue> namedParams = queryImpl.getNamedParams();
Set<Entry<String, TypedValue>> entrySet = namedParams.entrySet();
for (Entry<String, TypedValue> entry : entrySet) {
countQuery.setParameter(entry.getKey(),entry.getValue().getValue());
}