Interface: FetchListParameters

Oracle® JavaScript Extension Toolkit (JET)
17.1.0

G12196-01

Since:
  • 4.1.0
Module:
  • ojdataprovider

QuickNav

Fields

Description

Defines the parameters to the DataProvider method DataProvider#fetchFirst


Usage

Signature:

interface FetchListParameters<D>

Generic Parameters
ParameterDescription
DType of Data
Typescript Import Format
//To use this interface, import as below.
import {FetchListParameters} from "ojs/ojdataprovider";

For additional information visit:


Fields

(nullable) attributes :Array.<(string|FetchAttribute)>

Optional attributes to include in the result. If specified, then at least these set of attributes must be included in each row in the data array in the FetchListResult. If not specified then the default attributes must be included.
Since:
  • 6.1.0
Examples
['!lastName', '@default'] // all attributes except lastName
['!lastName', '@default', {name: 'location', attributes: ['address line 1', 'address line 2']}] // nested example

(nullable) clientId :symbol

Optional symbol that can uniquely identify the consumer of the DataProvider. Each consumer can call Symbol() to obtain a unique symbol, which can be stored and reused on each subsequent call to fetchFirst. Note that Symbol() returns a different unique symbol every time, so it should not be called every time the consumer calls fetchFirst. There should only be one active iterator per clientId. All previous iterators obtained with the same clientId should be considered invalid. This is used to optimize resource usage in some DataProvider implementations.
Since:
  • 9.0.0

(nullable) filterCriterion :DataFilter.Filter.<D>

Optional filter criterion to apply. The filter criterion would be composed of a supported DataFilter.Filter such as a AttributeFilter, AttributeExprFilter, ExtendedCompoundFilter, NestedFilter, TextFilter.
Since:
  • 4.1.0
Example
let filterDef = {op: '$or', criteria: [{op: '$eq', value: {name: 'Bob'}}, {op: '$gt', value: {level: 'Low'}}]};
let filter = FilterFactory.getFilter({filterDef}); // create a standard filter using the filterFactory.
let fetchListParam = {filterCriterion: filter, size: 5};

(nullable) includeFilteredRowCount :('enabled'|'disabled')

Optional property to request that the total filtered row count be included in the fetch result. The total filtered row count is a count of all the rows that can be iterated after applying any filterCriterion.

Valid values are:

  • "enabled": Total row count should be included in the fetch result.
  • "disabled": Total row count should not be included in the fetch result.

The default is 'disabled'.

Not all DataProvider implementations support returning total filtered row count. Consumers should check if the value is a valid number before trying to use it.

Since:
  • 12.0.0
Example

Request and use totalFilteredRowCount

const fetchListParams = {includeFilteredRowCount: 'enabled'};
const asyncIterator = dataprovider.fetchFirst(fetchListParams)[Symbol.asyncIterator]();
let iteratorResult = await asyncIterator.next();
let fetchListResult = iteratorResult.value;
let totalFilteredRowCount = fetchListResult.totalFilteredRowCount;
if (typeof totalFilteredRowCount === 'number' && totalFilteredRowCount !== -1) {
  // Do something with totalFilteredRowCount if available
}

(nullable) signal :AbortSignal

The AbortSignal from AbortController. A signal associated with fetchFirst so that this request can be aborted later.
Since:
  • 14.0.0

(nullable) size :number

Optional number of rows to fetch. If fewer than that number of rows exist, the fetch will succeed but be truncated. A value of -1 will return all rows or the maximum size supported by the DataProvider. If the size is not specified or is 0, then the DataProvider implementation will determine how many rows to return.
Since:
  • 4.1.0

(nullable) sortCriteria :Array.<SortCriterion.<D>>

Optional sort criteria to apply.
Since:
  • 4.1.0
Example
[{attribute: 'DepartmentName', direction: 'ascending'}]