All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.aqiu202.starters.jpa.page.JPAPageResult Maven / Gradle / Ivy

There is a newer version: 1.2.1
Show newest version
package com.github.aqiu202.starters.jpa.page;

import com.noah.base.page.PageResult;
import com.noah.base.page.PageableInput;
import com.querydsl.core.QueryResults;
import java.util.List;
import org.springframework.data.domain.Page;

public class JPAPageResult extends PageResult {

    private JPAPageResult(List rows, long total) {
        super(rows, total);
    }

    public static  PageResult of(Page page, PageableInput pageable) {
        return of(page).pageable(pageable);
    }

    public static  PageResult of(QueryResults page, PageableInput pageable) {
        return of(page).pageable(pageable);
    }

    public static  PageResult of(Page page) {
        return of(page.getContent(), page.getTotalElements());
    }

    public static  PageResult of(QueryResults page) {
        return of(page.getResults(), page.getTotal());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy