update method

  1. @override
FutureOr<void> update(
  1. HouseholdMemberModel entity, {
  2. bool createOpLog = true,
})
override

The update method updates an existing entity.

Implementation

@override
FutureOr<void> update(
  HouseholdMemberModel entity, {
  bool createOpLog = true,
}) async {
  return retryLocalCallOperation(() async {
    final householdMemberCompanion = entity.companion;

    await sql.batch((batch) {
      batch.update(
        sql.householdMember,
        householdMemberCompanion,
        where: (table) => table.clientReferenceId.equals(
          entity.clientReferenceId,
        ),
      );
    });

    await super.update(entity, createOpLog: createOpLog);
  });
}