Beispiel #1
0
  /**
   * 创建一条记录
   *
   * @param accessInfo
   * @return
   */
  public long create(AccessInfo accessInfo) {
    ContentValues values = new ContentValues();

    values.put(AccessInfoColumn.USERID, accessInfo.getUserID());
    values.put(AccessInfoColumn.ACCESS_TOKEN, accessInfo.getAccessToken());
    values.put(AccessInfoColumn.ACCESS_SECRET, accessInfo.getAccessSecret());

    return newsDB.insert(DBHelper.ACCESSLIB_TABLE, null, values);
  }
Beispiel #2
0
  /**
   * 更新
   *
   * @param image
   * @return
   */
  public boolean update(AccessInfo accessInfo) {
    ContentValues values = new ContentValues();

    values.put(AccessInfoColumn.USERID, accessInfo.getUserID());
    values.put(AccessInfoColumn.ACCESS_TOKEN, accessInfo.getAccessToken());
    values.put(AccessInfoColumn.ACCESS_SECRET, accessInfo.getAccessSecret());

    String whereClause = AccessInfoColumn.USERID + "=" + accessInfo.getUserID();

    return newsDB.update(DBHelper.ACCESSLIB_TABLE, values, whereClause, null) > 0;
  }