updateBean method

Future<int> updateBean (Bean bean)

Implementation

Future<int> updateBean(Bean bean) async {
  Database db = await this.db;
  int id;
  bean.setUpdatedTime();
  try {
    Map<String, dynamic> sdMap = bean.toSerializableMap();
    id = await db.update(this.tableName, sdMap,
        where: "_id=?", whereArgs: [bean.identifier]);
  } catch (e) {
    await this.close();
    throw new Exception(e);
  }
  return id;
}