Pagination<T> p = new Pagination<T>();
List<T> list = findByQueryNative(query, params, start, pageSize);
p.setItems(list);
String countQueryString = getCountQueryStringForHql(queryString);
if(withGroupby)
p.setCount((long)findByQueryNative(session.createQuery(countQueryString), params, -1, -1).size());
else
p.setCount((Long)findByQueryNative(session.createQuery(countQueryString), params, -1, -1).iterator().next());
return setPagination(p, start, pageSize, sorts);
}else{
return findByQueryNative(queryString, params, sorts, start, pageSize, withGroupby);