query(entityClass, filter = null, order = null, offset = 0, limit = null) {
    validateEntityClass(entityClass)

    let storeName = entityClass.objectStore

    if (this[PRIVATE.rwTransactionRunner]) {
      let keyPath
      return this[PRIVATE.runTransactionOperation]((transaction) => {
        let objectStore = transaction.getObjectStore(storeName)
        keyPath = objectStore.keyPath
        return objectStore.query(filter, order, offset, limit)
      }).then((entities) => {
        return entities.map((entityData) => {
          return this[PRIVATE.manage](entityClass, keyPath, entityData)
        })
      })
    }

    return this[PRIVATE.connection].then((database) => {
      return database.runReadOnlyTransaction(storeName, (objectStore) => {
        return objectStore.query(filter, order, offset, limit)
      })
    }).then((records) => {
      return records.map(record => new entityClass(record))
    })
  }
/**
   * Fetches the entities matched by the specified query.
   *
   * The entities will not be locked in the database nor managed by this entity
   * manager if an entity manager transaction is not in progress.
   *
   * @template {T} extends AbstractEntity
   * @param {function(new: T, data: Object<string, *>)} entityClass The entity
   *        class, specifying the type of entities to fetch.
   * @param {?(undefined|number|string|Date|Array|IDBKeyRange|Object<string, (number|string|Date|Array|IDBKeyRange)>|function(*, (number|string|Date|Array)): boolean)=} filter
   *        The filter, restricting the records returned by this method. If a
   *        function is provided, the first argument will be set to the record
   *        and the second argument will be set to the primary key of the
   *        record.
   * @param {?(CursorDirection|string|string[]|function(*, *): number)} order
   *        How the resulting records should be sorted.
   * @param {number} offset The index of the first record to include in the
   *        result. The records are numbered from {@code 0}, the offset must be
   *        a non-negative integer.
   * @param {?number} limit The maximum number of records to return as a
   *        result. The limit must be a positive integer, or {@code null} if no
   *        limit should be imposed.
   * @return {Promise<T[]>} A promise that resolves to the records matched by
   *         the specified query.
   */
Fetches the entities matched by the specified query.
The entities will not be locked in the database nor managed by this entity
manager if an entity manager transaction is not in progress.

@template {T} extends AbstractEntity
@param {function(new: T, data: Object)} entityClass The entity
class, specifying the type of entities to fetch.
Fetches the entities matched by the specified query . The entities will not be locked in the database nor managed by this entity manager if an entity manager transaction is not in progress . @template { T } extends AbstractEntity @param { function ( new : T data : Object ) } entityClass The entity class specifying the type of entities to fetch .
query(entityClass, filter = null, order = null, offset = 0, limit = null) {
    validateEntityClass(entityClass)
    let storeName = entityClass.objectStore
    if (this[PRIVATE.rwTransactionRunner]) {
      let keyPath
      return this[PRIVATE.runTransactionOperation]((transaction) => {
        let objectStore = transaction.getObjectStore(storeName)
        keyPath = objectStore.keyPath
        return objectStore.query(filter, order, offset, limit)
      }).then((entities) => {
        return entities.map((entityData) => {
          return this[PRIVATE.manage](entityClass, keyPath, entityData)
        })
      })
    }
    return this[PRIVATE.connection].then((database) => {
      return database.runReadOnlyTransaction(storeName, (objectStore) => {
        return objectStore.query(filter, order, offset, limit)
      })
    }).then((records) => {
      return records.map(record => new entityClass(record))
    })
  }
query ( entityClass , filter = null , order = null , offset = 0 , limit = null ) { validateEntityClass ( entityClass ) let storeName = entityClass . objectStore if ( this [ PRIVATE . rwTransactionRunner ] ) { let keyPath return this [ PRIVATE . runTransactionOperation ] ( ( transaction ) => { let objectStore = transaction . getObjectStore ( storeName ) keyPath = objectStore . keyPath return objectStore . query ( filter , order , offset , limit ) } ) . then ( ( entities ) => { return entities . map ( ( entityData ) => { return this [ PRIVATE . manage ] ( entityClass , keyPath , entityData ) } ) } ) } return this [ PRIVATE . connection ] . then ( ( database ) => { return database . runReadOnlyTransaction ( storeName , ( objectStore ) => { return objectStore . query ( filter , order , offset , limit ) } ) } ) . then ( ( records ) => { return records . map ( record => new entityClass ( record ) ) } ) }
Fetches the entities matched by the specified query.
Fetches the entities matched by the specified query .