Package NTNU.IDATT1002.repository
Class PagingAndSortingRepository<T,ID>
java.lang.Object
NTNU.IDATT1002.repository.AbstractRepository<T,ID>
NTNU.IDATT1002.repository.PagingAndSortingRepository<T,ID>
- Type Parameters:
T- type of entityID- type of entity id
- All Implemented Interfaces:
Repository<T,ID>
- Direct Known Subclasses:
AlbumRepository,ImageRepository
public abstract class PagingAndSortingRepository<T,ID> extends AbstractRepository<T,ID>
Paging and Sorting Repository.
Supports operations for requesting paginated and sorted results.
-
Field Summary
Fields inherited from class NTNU.IDATT1002.repository.AbstractRepository
entityClass, entityManager, logger -
Constructor Summary
Constructors Modifier Constructor Description protectedPagingAndSortingRepository(javax.persistence.EntityManager entityManager) -
Method Summary
Modifier and Type Method Description Page<T>findAll(PageRequest pageRequest)Find all entities specified by givenPageRequest.Methods inherited from class NTNU.IDATT1002.repository.AbstractRepository
delete, deleteById, findAll, findById, save, setEntityClass, update
-
Constructor Details
-
PagingAndSortingRepository
protected PagingAndSortingRepository(javax.persistence.EntityManager entityManager)
-
-
Method Details
-
findAll
Find all entities specified by givenPageRequest. Queries for the total amount of results to support proper pagination.- Parameters:
pageRequest- thePageRequestspecifying which page and how many entities to query for, with an optionalSort- Returns:
Pageconsisting of the results of this operation
-