code: public void replaceChildren(List<T> list, String parentId) {
  		for (T item : list) {
  			item.setParentId(parentId);
  		}
  		@SuppressWarnings("resource")
  		SQLiteDatabase db = dbHelper.getWritableDatabase();
  		boolean endTransaction = beginTransaction(db);
  		try {
  			db.delete(getTableName(), getParentIdColumnName() + "=?", new String[] { parentId });
  			addAll(list);
  			LOGGER.trace("Replaced children of parent " + parentId + " and type " + getTableName());
  			successTransaction(db, endTransaction);
  		} finally {
  			endTransaction(db, endTransaction);
  		}
  	}
docs: This method allows to replace all entity children of a given parent, it will remove any children which are not in
  the list, add the new ones and update which are in the list..
  
  @param list of children to replace.
  @param parentId id of parent entity.