Interface TableDataSource<T>
- Type Parameters:
T- the type of entities returned by this data source
public interface TableDataSource<T>
Data-source interface for paginated, sortable, and filterable table data used by
TableDataProvider.
Implementors supply a page of entries for a given offset and page size as well as the total record count,
both taking an arbitrary map of filter criteria into account.-
Method Summary
Modifier and TypeMethodDescriptiongetEntries(int first, int pageSize, String sortField, TableDataProvider.SortOrder sortOrder, Map<String, String> filters) getEntries.longgetTotalNumberOfRecords(Map<String, String> filters) getTotalNumberOfRecords.voidresetTotalNumberOfRecords.
-
Method Details
-
getEntries
List<T> getEntries(int first, int pageSize, String sortField, TableDataProvider.SortOrder sortOrder, Map<String, String> filters) throws TableDataSourceExceptiongetEntries.- Parameters:
first- zero-based index of the first result to return.pageSize- maximum number of results to return.sortField- field name to sort by; null for default order.sortOrder- ascending or descending sort direction.filters- map of field names to filter values.- Returns:
- a list of entries for the requested page, sorted and filtered according to the given parameters
- Throws:
TableDataSourceException- if any.
-
getTotalNumberOfRecords
getTotalNumberOfRecords.- Parameters:
filters- map of field names to filter values applied to the count.- Returns:
- a long.
-
resetTotalNumberOfRecords
void resetTotalNumberOfRecords()resetTotalNumberOfRecords.
-