boycod3 boycod3 - 6 months ago 57
Java Question

How to use spring Page without spring data

Hi i'm using below code for find article using spring with plain hibernate.

public List<Article> getArticles(int currPosition, int pageSize) {
Criteria c = getSession().createCriteria(Article.class);
List<Article> result = c.list();
return result;

i'm not using spring data in my project now, So how can i use
with my project.

Page<Person> persons = personService.findAllPageable(new PageRequest(evalPage, evalPageSize));


You can use Pageable#getSize to set maxResults, Pageable#getOffset for setFirstResult and Pageable#getSort to obtain sorting parameters.