Esempio n. 1
0
 /** @inheritdoc */
 @Override
 public Long getKey(NewsJumpBean entity) {
   if (entity != null) {
     return entity.getId();
   } else {
     return null;
   }
 }
Esempio n. 2
0
  /** @inheritdoc */
  @Override
  protected void bindValues(SQLiteStatement stmt, NewsJumpBean entity) {
    stmt.clearBindings();

    Long id = entity.getId();
    if (id != null) {
      stmt.bindLong(1, id);
    }

    String url = entity.getUrl();
    if (url != null) {
      stmt.bindString(2, url);
    }

    String content = entity.getContent();
    if (content != null) {
      stmt.bindString(3, content);
    }
  }
Esempio n. 3
0
 /** @inheritdoc */
 @Override
 public void readEntity(Cursor cursor, NewsJumpBean entity, int offset) {
   entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
   entity.setUrl(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
   entity.setContent(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
 }
Esempio n. 4
0
 /** @inheritdoc */
 @Override
 protected Long updateKeyAfterInsert(NewsJumpBean entity, long rowId) {
   entity.setId(rowId);
   return rowId;
 }