Skip to content

bxfsh/boxfish-commons-web-model-paging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

boxfish-commons-web-model-paging

Boxfish Logo

By Boxfish

Build Status

Effortless paging for Boxfish Model + Spring Data Paging

  • Single command to extract a Pageable from a Model
  • Spring JPA Repository compatible
  • PagedOutput class to standardise your paged DTO

Depends on:

Why another paging library?

If you are using the Boxfish Model there will be the time win which producing the Pageable object for your JPA Repositories (or any other Spring Data pagination system) will become too repetitive.

This model sorts that problem out for you with a one-liner:

	  // Controller.java
    @RequestMapping(value = "", method = RequestMethod.GET)
    public ResponseEntity<?> list(final @RequestParam Map query) {
        final Pageable paging = PagingInfo.from(query);
        final PagedOutput<Entity> wrapper = PagedOutput.wrap(repo.list(paging);
        return ResponseEntity.ok(wrapper);
    }

Releases

No releases published

Packages

No packages published

Languages