Пример #1
0
  /**
   * Update an existed person.
   *
   * @param p The person to be updated.
   */
  public void updatePerson(Person p) {
    long personId = p.getId();

    database.update(H.TABLE_PERSONS, personToValue(p), H.P_ID + " = " + personId, null);
  }
Пример #2
0
 /**
  * Delete a Person in the database.
  *
  * @param p The person to be deleted
  */
 public void deletePerson(Person p) {
   long id = p.getId();
   database.delete(H.TABLE_PERSONS, H.P_ID + " = " + id, null);
   database.delete(H.TABLE_EVENTS, H.E_OWNER + " = " + id, null);
 }