Class: FetchByKeysMixin

Oracle® JavaScript Extension Toolkit (JET)
5.0.0

E90577-01

QuickNav

PREVIEW: This is a preview API. Preview APIs are production quality, but can be changed on a major version without a deprecation path.

FetchByKeysMixin

Version:
  • 5.0.0
Since:
  • 4.2.0
Module:
  • ojdataprovider
Mixin class to provide generic implementation of fetchByKeys and containsKeys methods for the oj.DataProvider interface.

By default, the mixin implementation will iterate through all the rows to find the result. DataProvider implementations can implement a "getIterationLimit" function that returns a row limit for the iteration:
getIterationLimit() => number

This class cannot be instantiated. You can only call the static applyMixin method to add the implementation to another class.

PREVIEW: This is a preview API. Preview APIs are production quality, but can be changed on a major version without a deprecation path.

Methods

(static) applyMixin(derivedCtor)

PREVIEW: This is a preview API. Preview APIs are production quality, but can be changed on a major version without a deprecation path.

Apply this mixin to another class
Parameters:
Name Type Description
derivedCtor function the constructor of an existing class
Examples

Apply the mixin in Typescript:

class CustomDataProvider<K, D> implements DataProvider<K, D> {
  // Add stand-in properties to satisfy the compiler
  containsKeys: (parameters: FetchByKeysParameters<K>) => Promise<ContainsKeysResults<K>>;
  fetchByKeys: (parameters: FetchByKeysParameters<K>) => Promise<FetchByKeysResults<K, D>>;

  constructor() {
    // Constructor implementation
  }
}

oj.FetchByKeysMixin.applyMixin(CustomDataProvider);

Apply the mixin in Javascript:

function CustomDataProvider() {
  // Constructor implementation
}

oj.FetchByKeysMixin.applyMixin(CustomDataProvider);