added use of criteriaQuery in pagination #21

Please review and merge if all OK #21