getMany method
Returns a list of ids.length
Objects of type T, each corresponding to
the location of its ID in ids
. Non-existent IDs become null.
Pass growableResult: true for the resulting list to be growable.
Implementation
List<T?> getMany(List<int> ids, {bool growableResult = false}) {
final result = List<T?>.filled(ids.length, null, growable: growableResult);
if (ids.isEmpty) return result;
final tx = Transaction(_store, TxMode.read);
try {
final cursor = tx.cursor(_entity);
for (var i = 0; i < ids.length; i++) {
final object = cursor.get(ids[i]);
if (object != null) result[i] = object;
}
return result;
} finally {
tx.close();
}
}