Last active
April 16, 2020 17:54
-
-
Save Raouf25/9c761f4a8bad37fef499b0437f4ffc1b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* get element using Criteria. | |
* | |
* @param spec * | |
* @param headers pagination data | |
* @param sort sort criteria | |
* @return retrieve elements with pagination | |
*/ | |
public PagingResponse get(Specification<Car> spec, HttpHeaders headers, Sort sort) { | |
if (isRequestPaged(headers)) { | |
return get(spec, buildPageRequest(headers, sort)); | |
} else { | |
final List<Car> entities = get(spec, sort); | |
return new PagingResponse((long) entities.size(), 0L, 0L, 0L, 0L, entities); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment