Finds record internalId's.
@param {Ext.data.Store} store
@param {Object} rowData [[dataIndex, value], [dataIndex, value]]
@return {number[]}
344736
function findRecordIds(store, rowData) {

      var internalIds = [];

      store.each(function (m) {
        for (var i = 0; i < rowData.length; i++) {
          var item = rowData[i];
          var dataIndex = item[0];
          var value = item[1];
          var fieldValue = m.get(dataIndex);
          if (fieldValue !== value) {
            return true; // To next record.
          }
        }
        internalIds.push(m.internalId);
        return true;
      });

      if (!internalIds.length) {
        throw new Error('Record not found for ' + JSON.stringify(rowData));
      }

      return internalIds;
    }
268249
function (data) {
        var items = [];
        data.forEach(function (d, i) {
            if (d.includes('ITEM:') && d.length > 3) {
                var iid = data[i + 1];
                var item = {
                    item: {
                        id: Number(iid[1].trim()),
                        name: d[2].replace(/_/g, ' '),
                        price: d[3],
                        change: d[4]
                    }
                };
                items.push(item);
            }
        });
        return items;
    }
290252
function getRows (elements, row) {
  if (!row) {
    return [ elements ]
  }

  let lastOffset = false

  return elements.reduce((rows, el) => {

    if (lastOffset !== el.offsetTop) {
      rows.push([el])
    } else {
      rows[rows.length - 1].push(el)
    }

    lastOffset = el.offsetTop

    return rows

  }, [])
}
613752
@Override
    public RowIterator findFirstRowNotNull(Session session,
                                           PersistentStore store) {

        readLock.lock();

        try {
            NodeAVL x = getAccessor(store);

            while (x != null) {
                boolean t = colTypes[0].compare(
                    null, x.getRow(store).getData()[colIndex[0]]) >= 0;

                if (t) {
                    NodeAVL r = x.getRight(store);

                    if (r == null) {
                        break;
                    }

                    x = r;
                } else {
                    NodeAVL l = x.getLeft(store);

                    if (l == null) {
                        break;
                    }

                    x = l;
                }
            }

            while (x != null) {
                Object colvalue = x.getRow(store).getData()[colIndex[0]];

                if (colvalue == null) {
                    x = next(store, x);
                } else {
                    break;
                }
            }

// MVCC
            while (session != null && x != null) {
                Row row = x.getRow(store);

                if (session.database.txManager.canRead(session, row)) {
                    break;
                }

                x = next(store, x);
            }

            return getIterator(session, store, x);
        } finally {
            readLock.unlock();
        }
    }
102570
function (store, json) {
    var handledRecords = [], key, records, handleRecord, Model;
    handleRecord = function (record) {
      this.completeJsonForRecord(store, record, Model, json, handledRecords);
    };
    for (key in json) {
      if (json.hasOwnProperty(key)) {
        records = json[key];
        Model = store.modelFor(singularize(key));
        forEach(records, handleRecord, this);
      }
    }
    return json;
  }
106279
private Iterator<Record> rowQuery(final List<Map.Entry<ByteBuffer, Key>> rowKeys, final ReadConsistency consistency,
                                      final DeltaPlacement placement) {
        List<ByteBuffer> keys = Lists.newArrayListWithCapacity(rowKeys.size());
        final Map<ByteBuffer, Key> rawKeyMap = Maps.newHashMap();
        for (Map.Entry<ByteBuffer, Key> entry : rowKeys) {
            keys.add(entry.getKey());
            rawKeyMap.put(entry.getKey(), entry.getValue());
        }

        BlockedDeltaTableDDL tableDDL = placement.getBlockedDeltaTableDDL();

        Statement statement = selectDeltaFrom(tableDDL)
                .where(in(tableDDL.getRowKeyColumnName(), keys))
                .setConsistencyLevel(SorConsistencies.toCql(consistency));

        Iterator<Iterable<Row>> rowGroups = deltaQueryAsync(placement, statement, false, "Failed to read records %s", rawKeyMap.values());

        return Iterators.concat(
                // First iterator reads the row groups found and transforms them to Records
                Iterators.transform(rowGroups, rows -> {
                    ByteBuffer keyBytes = getRawKeyFromRowGroup(rows);
                    Key key = rawKeyMap.remove(keyBytes);
                    assert key != null : "Query returned row with a key out of bound";
                    return newRecordFromCql(key, rows, placement, ByteBufferUtil.bytesToHex(keyBytes));
                }),
                // Second iterator returns an empty Record for each key queried but not found.
                new AbstractIterator<Record>() {
                    private Iterator<Key> _nonExistentKeyIterator;

                    @Override
                    protected Record computeNext() {
                        // Lazily return an empty record for each key not found in the previous iterator.
                        // rawKeyMap.iterator() must not be called until the first iterator is completely spent.
                        if (_nonExistentKeyIterator == null) {
                            _nonExistentKeyIterator = rawKeyMap.values().iterator();
                        }
                        return _nonExistentKeyIterator.hasNext() ?
                                emptyRecord(_nonExistentKeyIterator.next()) :
                                endOfData();
                    }
                });
    }
207708
@Override
    public final Object find(Class entityClass, Object rowId)
    {
        return super.find(entityClass, rowId);
    }
1214745
private Object getRowData(final Object rowId) {
		// We cache row id --> row bean mapping per request for performance (to avoid nested loops)
		Map dataByRowId = (Map) getScratchMap().get(SCRATCHMAP_DATA_BY_ROW_ID_KEY);

		if (dataByRowId == null) {
			dataByRowId = createRowIdCache();
		}

		Object data = dataByRowId.get(rowId);

		if (data == null && !dataByRowId.containsKey(rowId)) {
			// Ok, new data has probably been added. We need to cache the new data.
			dataByRowId = createRowIdCache();
			data = dataByRowId.get(rowId);
		}

		return data;
	}
944954
public Object find(Class entityClass, Object rowId) {
        EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entityClass);
        List<String> relationNames = entityMetadata.getRelationNames();
        return find(entityClass, entityMetadata, rowId, relationNames);
    }
141829
function recordCursor(records, id) {
  var record;
  id = coerceId(id);
  for (var i = 0, len = records.length; i < len; i++) {
    record = records[i];
    if (coerceId(record.id) === id) {
      return {record: record, index: i};
    }
  }
}
451361
function IDBDatabase(db, name, version, storeProperties){
        this.__db = db;
        this.__closed = false;
        this.version = version;
        this.name = name;
        this.onabort = this.onerror = this.onversionchange = null;

        this.__objectStores = {};
        this.objectStoreNames = new idbModules.util.StringList();
        for (var i = 0; i < storeProperties.rows.length; i++) {
            var store = new idbModules.IDBObjectStore(storeProperties.rows.item(i));
            this.__objectStores[store.name] = store;
            this.objectStoreNames.push(store.name);
        }
    }
240361
function getCodes(type) {
    if (isValidType(type)) {
        return forAll(data, function getCodesIterator(row) {
            return row[type];
        });
    }
}
1062833
function lookup(jobAsked) {
    let hits = [];
    let query = jobAsked.getSerialIdentity();
    for (let job of sourceJobIter()) {
        let item = job.getSerialIdentity();
        if (isConstraintsOk(query, item))
            hits.push(job);
    }
    logger.debug(`Found ${hits.length} hits`);
    if (hits.length == 0)
        return undefined;
    return hits;
}
169284
function entitiesToDatastore(entities, options) {
    const multiple = is.array(entities);
    entities = arrify(entities);

    if (entities[0].className !== 'Entity') {
        // Not an entity instance, nothing to do here...
        return entities;
    }

    const result = entities.map(e => toDatastore(e, options));

    return multiple ? result : result[0];
}
194285
private List<Integer> getRowIds(final int startIndex, final int endIndex) {
		// If the table is sorted, we may require a mapping for table row index <--> data model index.
		int[] rowIndexMapping = getComponentModel().rowIndexMapping;

		// Check if sort mapping needs updating
		if (isSorted() && rowIndexMapping != null && rowIndexMapping.length != getDataModel().
				getRowCount()) {
			rowIndexMapping = getDataModel().sort(getSortColumnIndex(), isSortAscending());
			getOrCreateComponentModel().rowIndexMapping = rowIndexMapping;
		}

		if (rowIndexMapping == null) {
			// No mapping, return from startIndex to endIndex
			return new RowIdList(startIndex, endIndex);
		} else {
			List<Integer> rowIds = new ArrayList<>(endIndex - startIndex + 1);

			for (int i = startIndex; i <= endIndex; i++) {
				rowIds.add(rowIndexMapping[i]);
			}

			return rowIds;
		}

	}
543914
void insertRow(Session session, PersistentStore store, Object[] data) {

        setIdentityColumn(session, data);

        if (triggerLists[Trigger.INSERT_BEFORE].length != 0) {
            fireBeforeTriggers(session, Trigger.INSERT_BEFORE, null, data,
                               null);
        }

        if (isView) {
            return;
        }

        checkRowDataInsert(session, data);
        insertNoCheck(session, store, data);
    }
147071
function (page) {
        if (!lang.isNumber(page)) {
            page = this.getCurrentPage();
        }

        var perPage = this.get('rowsPerPage'),
            records = this.get('totalRecords'),
            start, end;

        if (!page || !perPage) {
            return null;
        }

        start = (page - 1) * perPage;
        if (records !== Paginator.VALUE_UNLIMITED) {
            if (start >= records) {
                return null;
            }
            end = Math.min(start + perPage, records) - 1;
        } else {
            end = start + perPage - 1;
        }

        return [start,end];
    }