paginateByQuery method
EntityPagination<O>
paginateByQuery(
- String query, {
- Object? parameters,
- List? positionalParameters,
- Map<
String, Object?> ? namedParameters, - required int limit,
- bool? orderByID,
- OrderDirection? orderDirection,
- Transaction? transaction,
- EntityResolutionRules? resolutionRules,
- EntityPaginationListener<
O> ? onEvent,
override
Returns an EntityPagination over this select, loading nothing yet: pages are fetched only when asked for. See EntityPagination.
-
limit: the page size. Required, and must be> 0. -
orderByID: defaults totrue. A paginated read is only meaningful over a stable order, so unlike theselect*methods this is on by default instead of being implied by an offset. -
orderDirection: the OrderDirection of the ordering. -
onEvent: an optional hook notified of what is being fetched. See EntityPaginationEvent. -
resolutionRules: applied to every loaded page.
Implementation
@override
EntityPagination<O> paginateByQuery(
String query, {
Object? parameters,
List? positionalParameters,
Map<String, Object?>? namedParameters,
required int limit,
bool? orderByID,
OrderDirection? orderDirection,
Transaction? transaction,
EntityResolutionRules? resolutionRules,
EntityPaginationListener<O>? onEvent,
}) => EntityPagination<O>(
limit: limit,
onEvent: onEvent,
query: query,
pageLoader: (page, limit) => selectByQuery(
query,
parameters: parameters,
positionalParameters: positionalParameters,
namedParameters: namedParameters,
transaction: transaction,
limit: limit,
page: page,
orderByID: orderByID ?? true,
orderDirection: orderDirection,
resolutionRules: resolutionRules,
).resolveMapped((os) => os.toList()),
);