throw JPARSException.exceptionOccurred(ex);
}
}
private Response processPageableQuery(PersistenceContext context, String queryName, DatabaseQuery dbQuery, Query query, HttpHeaders headers, UriInfo uriInfo) {
final PageableQueryValidator validator = new PageableQueryValidator(context, queryName, uriInfo);
if (validator.isFeatureApplicable()) {
// Do pagination
query.setFirstResult(validator.getOffset());
query.setMaxResults(validator.getLimit());
return namedQueryResponse(context, queryName, dbQuery, query, headers, uriInfo, new PagingResponseBuilder());
} else {
// No pagination
return namedQueryResponse(context, queryName, dbQuery, query, headers, uriInfo, new SelfLinksResponseBuilder());
}