findFirst method
T?
findFirst()
Finds Objects matching the query and returns the first result or null if there are no results. Note: offset and limit are respected, if set.
Implementation
T? findFirst() {
T? result;
final visitor = dataVisitor((Pointer<Uint8> data, int size) {
result = _entity.objectFromFB(_store, data.asTypedList(size));
return false; // we only want to visit the first element
});
_store.runInTransaction(TxMode.read, () {
checkObx(C.query_visit(_ptr, visitor, nullptr));
});
return result;
}